Skip to content

Commit

Permalink
grep: simplify assignment of ->fixed
Browse files Browse the repository at this point in the history
After 885d211, the value of the ->fixed pattern option only depends on
the grep option of the same name.  Regex flags don't matter any more,
because fixed mode and regex mode are strictly separated.  Thus we can
simply copy the value from struct grep_opt to struct grep_pat, as we do
already for ->word_regexp and ->ignore_case.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Feb 3, 2010
1 parent 4b7acc1 commit 7928610
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)

p->word_regexp = opt->word_regexp;
p->ignore_case = opt->ignore_case;
p->fixed = opt->fixed;

if (opt->fixed)
p->fixed = 1;
if (opt->regflags & REG_ICASE)
p->fixed = 0;
if (p->fixed)
return;

Expand Down

0 comments on commit 7928610

Please sign in to comment.