From owner-svn-src-stable@FreeBSD.ORG Wed Jun 25 19:00:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46D04C69; Wed, 25 Jun 2014 19:00:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33E2F29CE; Wed, 25 Jun 2014 19:00:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PJ0Cp2078540; Wed, 25 Jun 2014 19:00:12 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PJ0CbN078539; Wed, 25 Jun 2014 19:00:12 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406251900.s5PJ0CbN078539@svn.freebsd.org> From: Glen Barber Date: Wed, 25 Jun 2014 19:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r267879 - stable/9/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 19:00:12 -0000 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)