Sorry for the repeated failure.
I re-send it.
>From 71158b2fa799379bdcdb6f5ac1b93f78566fbd44 Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <[email protected]>
Date: Wed, 26 Mar 2014 00:41:48 +0900
Subject: [PATCH] grep: running DFA in more narrow range after failure in
 exact match

* src/dfasearch.c (EGexecute): Running DFA in more narrow range after
failure in exact match.
---
 src/dfasearch.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/dfasearch.c b/src/dfasearch.c
index 0b56960..53f05f3 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -247,9 +247,14 @@ EGexecute (char const *buf, size_t size, size_t 
*match_size,
                       || !is_mb_middle (&mb_start, match, buflim,
                                         kwsm.size[0]))
                     goto success;
+                  if (dfaexec (dfa, mb_start, (char *) end, 0, NULL, &backref) 
== NULL)
+                    continue;
+                }
+              else
+                {
+                  if (dfaexec (dfa, beg, (char *) end, 0, NULL, &backref) == 
NULL)
+                    continue;
                 }
-              if (dfaexec (dfa, beg, (char *) end, 0, NULL, &backref) == NULL)
-                continue;
             }
           else
             {
-- 
1.9.1

Reply via email to