From: Junio C Hamano Date: Wed, 27 Sep 2006 23:42:53 +0000 (-0700) Subject: grep: fix --fixed-strings combined with expression. X-Git-Tag: v1.4.3-rc1~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a3f5d02edb2c1a037ed3ed8d2ebd3f3e5da9d198;p=git.git grep: fix --fixed-strings combined with expression. "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 --- diff --git a/grep.c b/grep.c index 2c740bde5..c411ddd4d 100644 --- a/grep.c +++ b/grep.c @@ -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;