aboutsummaryrefslogtreecommitdiff
path: root/builtin-grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-09 18:27:56 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-09 18:27:56 -0700
commit02ab1c490dc4827446c851468eb01ecc23b6cc48 (patch)
tree58742e40ee120a4e1edbb0faaf4ed5d5b1a46c7a /builtin-grep.c
parentc39c4f4746ba4543b532594543d252e2bad62234 (diff)
downloadgit-02ab1c490dc4827446c851468eb01ecc23b6cc48.tar.gz
git-02ab1c490dc4827446c851468eb01ecc23b6cc48.tar.xz
builtin-grep: -w fix
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index d290074af..52ac521af 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -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;