1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

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
This commit is contained in:
Glen Barber 2014-06-20 21:53:50 +00:00
parent fc39ce9ee1
commit 66edec08b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267693

View File

@ -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)