Thread (44 messages) flat view 44 messages, 3 authors, 2016-06-15
STALE3755d

Revision v6 of 2 in this series.

Revisions (2)
  1. v5 [diff vs current]
  2. v6 current

[PATCH v6 02/11] grep: break down an "if" stmt in preparation for next changes

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 23:08:08
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 grep.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/grep.c b/grep.c
index 7b2b96a..e739d20 100644
--- a/grep.c
+++ b/grep.c
@@ -403,9 +403,11 @@ 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 (is_fixed(p->pattern, p->patternlen))
 		p->fixed = 1;
-	else
+	else if (opt->fixed) {
+		p->fixed = 1;
+	} else
 		p->fixed = 0;
 
 	if (p->fixed) {
-- 
2.7.0.377.g4cd97dd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help