Paul Eggert wrote:
> Thanks for checking; I installed that combination of patches and am
> marking this as done.

Sorry, I have discovered a bug in your improvement, and fix it.

From 178a154fbea555275f02f0b883be0c04d60ecd37 Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <[email protected]>
Date: Thu, 1 May 2014 11:34:36 +0900
Subject: [PATCH] grep: fix the bug in previous patch.

* src/dfasearch.c (EGexecute): Do it.
---
 src/dfasearch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dfasearch.c b/src/dfasearch.c
index 5ad6c9d..6d27489 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -257,9 +257,9 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
               end = ((exact_kwset_match || !dfafast
                       || MAX (16, match - beg) < (match - prev_beg) >> 2)
                      ? match
-                     : (buflim - prev_beg) >> 2 <= match - beg
+                     : (buflim - prev_beg) >> 2 <= MAX (16, match - beg)
                      ? buflim
-                     : prev_beg + 4 * (match - beg));
+                     : prev_beg + 4 * MAX (16, match - beg));
               end = memchr (end, eol, buflim - end);
               end = end ? end + 1 : buflim;
 
-- 
1.9.2

Reply via email to