From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 16:15:56 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B461065670; Mon, 27 Feb 2012 16:15:56 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C98738FC0A; Mon, 27 Feb 2012 16:15:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGFuFC026227; Mon, 27 Feb 2012 16:15:56 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGFu9X026225; Mon, 27 Feb 2012 16:15:56 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271615.q1RGFu9X026225@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 16:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232223 - user/gabor/tre-integration/usr.bin/grep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:15:56 -0000 Author: gabor Date: Mon Feb 27 16:15:56 2012 New Revision: 232223 URL: http://svn.freebsd.org/changeset/base/232223 Log: - When having a match that is not a full match we cannot have a full match later in the same line. Modified: user/gabor/tre-integration/usr.bin/grep/util.c Modified: user/gabor/tre-integration/usr.bin/grep/util.c ============================================================================== --- user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 16:12:49 2012 (r232222) +++ user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 16:15:56 2012 (r232223) @@ -289,11 +289,14 @@ procline(struct str *l, int nottext) // XXX: better error msg? errx(2, "Failed processing input."); - /* Check for full match */ + /* + * Check for full match. There is already a match so + * if it fails it will not succeed later either. + */ if (xflag) if (pmatch.rm_so != 0 || (size_t)pmatch.rm_eo != l->len) - continue; + break; /* If reached here, we have a match. */ if (m == 0)