From: René Scharfe Date: Wed, 3 Feb 2010 18:16:30 +0000 (+0100) Subject: grep: simplify assignment of ->fixed X-Git-Tag: v1.7.0-rc2~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=79286102ce1620c5b0e73dc4559450eb24918e08;p=git.git grep: simplify assignment of ->fixed After 885d211e, 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 Signed-off-by: Junio C Hamano --- diff --git a/grep.c b/grep.c index 60cce469f..a0864f1cb 100644 --- a/grep.c +++ b/grep.c @@ -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;