[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] [PATCH 2/3] * src/fa.c (fa_as_regexp): fin only accepting state, no trans fin->fin



From: David Lutterkort <lutter redhat com>

---
 src/fa.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/fa.c b/src/fa.c
index a929887..2949f9b 100644
--- a/src/fa.c
+++ b/src/fa.c
@@ -3824,10 +3824,11 @@ int fa_as_regexp(struct fa *fa, char **regexp, size_t *regexp_len) {
         r = convert_trans_to_re(s);
         if (r < 0)
             goto error;
-        if (s->accept) {
+        if (s->accept && s != fin) {
             r = add_new_re_trans(s, fin, ref(eps));
             if (r < 0)
                 goto error;
+            s->accept = 0;
         }
     }
 
-- 
1.6.5.2



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]