Date: Mon, 27 Feb 2012 16:15:56 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r232223 - user/gabor/tre-integration/usr.bin/grep Message-ID: <201202271615.q1RGFu9X026225@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202271615.q1RGFu9X026225>