summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-06-20 21:53:50 +0000
committergjb <gjb@FreeBSD.org>2014-06-20 21:53:50 +0000
commit21bd32e7b47ce9d8c9ca93380993254ba62ffd66 (patch)
tree5fb147c4174ed1542938f8ebe82fae968fd81c4a /usr.bin
parent49152e1559083ac8f77aa5ab1257bdc5afa86db8 (diff)
downloadFreeBSD-src-21bd32e7b47ce9d8c9ca93380993254ba62ffd66.zip
FreeBSD-src-21bd32e7b47ce9d8c9ca93380993254ba62ffd66.tar.gz
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 MFC after: 3 days 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