Author: gjb
Date: Wed Jun 25 19:00:11 2014
New Revision: 267879
URL: http://svnweb.freebsd.org/changeset/base/267879

Log:
  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

Modified:
  stable/9/usr.bin/grep/util.c
Directory Properties:
  stable/9/usr.bin/grep/   (props changed)

Modified: stable/9/usr.bin/grep/util.c
==============================================================================
--- stable/9/usr.bin/grep/util.c        Wed Jun 25 18:59:43 2014        
(r267878)
+++ stable/9/usr.bin/grep/util.c        Wed Jun 25 19:00:11 2014        
(r267879)
@@ -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)
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to