Skip to content

Commit

Permalink
grep: fix --fixed-strings combined with expression.
Browse files Browse the repository at this point in the history
"git grep --fixed-strings -e GIT --and -e VERSION .gitignore"
misbehaved because we did not notice this needs to grab lines
that have the given two fixed strings at the same time.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 27, 2006
1 parent b48fb5b commit a3f5d02
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,13 @@ void compile_grep_patterns(struct grep_opt *opt)
{
struct grep_pat *p;

if (opt->fixed)
return;

/* First compile regexps */
for (p = opt->pattern_list; p; p = p->next) {
switch (p->token) {
case GREP_PATTERN: /* atom */
case GREP_PATTERN_HEAD:
case GREP_PATTERN_BODY:
compile_regexp(p, opt);
if (!opt->fixed)
compile_regexp(p, opt);
break;
default:
opt->extended = 1;
Expand Down

0 comments on commit a3f5d02

Please sign in to comment.