@matheusbsbs / matheus-bagliano / commits / 02ab1c490d
Fork 0

builtin-grep: -w fix

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed May 9, 2006 at 18:27 UTC 02ab1c490dc4827446c851468eb01ecc23b6cc48
1 file changed +3 -3
builtin-grep.c
+3 -3
@@ -241,10 +241,10 @@ static int grep_buffer(struct grep_opt *opt, const char *name,
241 die("regexp returned nonsense");
242 if (pmatch[0].rm_so != 0 &&
243 word_char(bol[pmatch[0].rm_so-1]))
244 - continue; /* not a word boundary */
245 - if ((eol-bol) < pmatch[0].rm_eo &&
244 + hit = 0;
245 + if (pmatch[0].rm_eo != (eol-bol) &&
246 word_char(bol[pmatch[0].rm_eo]))
247 - continue; /* not a word boundary */
247 + hit = 0;
248 }
249 if (hit)
250 break;