summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/grep.c b/grep.c
index 7b2b96a437..f430d7e756 100644
--- a/grep.c
+++ b/grep.c
@@ -403,7 +403,9 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
p->word_regexp = opt->word_regexp;
p->ignore_case = opt->ignore_case;
- if (opt->fixed || is_fixed(p->pattern, p->patternlen))
+ if (opt->fixed)
+ p->fixed = 1;
+ else if (is_fixed(p->pattern, p->patternlen))
p->fixed = 1;
else
p->fixed = 0;