Skip to content

Commit 7928610

Browse files
René Scharfegitster
authored andcommitted
grep: simplify assignment of ->fixed
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4b7acc1 commit 7928610

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

grep.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
5757

5858
p->word_regexp = opt->word_regexp;
5959
p->ignore_case = opt->ignore_case;
60+
p->fixed = opt->fixed;
6061

61-
if (opt->fixed)
62-
p->fixed = 1;
63-
if (opt->regflags & REG_ICASE)
64-
p->fixed = 0;
6562
if (p->fixed)
6663
return;
6764

0 commit comments

Comments
 (0)