bug-grep
[Top][All Lists]
Advanced

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

bug#17066: a DFA state which is built previously may be re-built in non-


From: Paolo Bonzini
Subject: bug#17066: a DFA state which is built previously may be re-built in non-UTF8 locales
Date: Tue, 01 Apr 2014 10:47:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Il 22/03/2014 07:59, Norihiro Tanaka ha scritto:

From fba7984fa2a5baff18e1b48611c3d7fb3701255b Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <address@hidden>
Date: Sat, 22 Mar 2014 15:11:52 +0900
Subject: [PATCH] grep: avoid to re-build a state built previously.

* src/dfa.c (dfaexec): avoid to re-build a state built previously.
---
 src/dfa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/dfa.c b/src/dfa.c
index 5e60cd5..8261849 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3501,7 +3501,8 @@ dfaexec (struct dfa *d, char const *begin, char *end,

       if (s >= 0)
         {
-          build_state (s, d);
+          if (!d->trans[s])
+            build_state (s, d);
           trans = d->trans;
           continue;
         }
-- 1.9.1

Thanks, I'll apply this patch.

Paolo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]