From 60452a30f5971c54ecdcd1bd389c1cabbbc844f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 25 Jun 2016 07:22:27 +0200 Subject: grep: break down an "if" stmt in preparation for next changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- grep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'grep.c') 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; -- cgit v1.2.3