Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jun 2014 19:22:41 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r267881 - releng/9.3/usr.bin/grep
Message-ID:  <201406251922.s5PJMf58091661@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Wed Jun 25 19:22:40 2014
New Revision: 267881
URL: http://svnweb.freebsd.org/changeset/base/267881

Log:
  MFS9 r267879:
    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
  Approved by:	re (marius)
  Sponsored by:	The FreeBSD Foundation

Modified:
  releng/9.3/usr.bin/grep/util.c
Directory Properties:
  releng/9.3/usr.bin/grep/   (props changed)

Modified: releng/9.3/usr.bin/grep/util.c
==============================================================================
--- releng/9.3/usr.bin/grep/util.c	Wed Jun 25 19:08:40 2014	(r267880)
+++ releng/9.3/usr.bin/grep/util.c	Wed Jun 25 19:22:40 2014	(r267881)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406251922.s5PJMf58091661>