Skip to content

Commit

Permalink
builtin-grep: -w fix
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed May 10, 2006
1 parent c39c4f4 commit 02ab1c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin-grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ static int grep_buffer(struct grep_opt *opt, const char *name,
die("regexp returned nonsense");
if (pmatch[0].rm_so != 0 &&
word_char(bol[pmatch[0].rm_so-1]))
continue; /* not a word boundary */
if ((eol-bol) < pmatch[0].rm_eo &&
hit = 0;
if (pmatch[0].rm_eo != (eol-bol) &&
word_char(bol[pmatch[0].rm_eo]))
continue; /* not a word boundary */
hit = 0;
}
if (hit)
break;
Expand Down

0 comments on commit 02ab1c4

Please sign in to comment.