summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-06-25 18:59:43 +0000
committergjb <gjb@FreeBSD.org>2014-06-25 18:59:43 +0000
commita8966aac9eaea59cf8e4df012b9f1a56441f271e (patch)
tree134054f9763709ed67514012a74336fd98c58a72 /usr.bin
parentec8b74659a691e0c2c44e39f4d45de0e3028e851 (diff)
downloadFreeBSD-src-a8966aac9eaea59cf8e4df012b9f1a56441f271e.zip
FreeBSD-src-a8966aac9eaea59cf8e4df012b9f1a56441f271e.tar.gz
MFC r267693:
Fix a bug in bsdgrep(1) where patterns are not correctly detected. Certain criteria must be met for this bug to show up: * the -w flag is specified, and * neither -o or --color are specified, and * the pattern is part of another word in the line, and * the other word that contains the pattern occurs first PR: 181973 Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/grep/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index 0a3706f..15b2da7 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -336,7 +336,7 @@ procline(struct str *l, int nottext)
}
/* One pass if we are not recording matches */
- if ((color == NULL && !oflag) || qflag || lflag)
+ if (!wflag && ((color == NULL && !oflag) || qflag || lflag))
break;
if (st == (size_t)pmatch.rm_so)
OpenPOWER on IntegriCloud