Hi,
I think that it would be better to be corrected as follows. Please point
out if the idea is wrong.
diff -ru grep-2.5.4.183-9159-dirty.orig/src/search.c
grep-2.5.4.183-9159-dirty/src/search.c
--- grep-2.5.4.183-9159-dirty.orig/src/search.c 1970-01-01 00:00:01.000000000
+0000
+++ grep-2.5.4.183-9159-dirty/src/search.c 2010-03-19 09:39:04.000000000
+0000
@@ -418,15 +418,17 @@
match = beg;
while (beg > buf && beg[-1] != eol)
--beg;
- if (kwsm.index < kwset_exact_matches)
- {
#ifdef MBS_SUPPORT
- if (mb_start < beg)
- mb_start = beg;
- if (MB_CUR_MAX == 1 || !is_mb_middle (&mb_start, match,
buflim))
+ if (mb_start < beg)
+ mb_start = beg;
+ if (MB_CUR_MAX > 1 || is_mb_middle (&mb_start, match, buflim))
+ {
+ end = mb_start;
+ continue;
+ }
#endif
- goto success;
- }
+ if (kwsm.index < kwset_exact_matches)
+ goto success;
if (dfaexec (&dfa, beg, (char *) end, 0, NULL, &backref) == NULL)
continue;
}