svn commit: r232223 - user/gabor/tre-integration/usr.bin/grep
Gabor Kovesdan
gabor at FreeBSD.org
Mon Feb 27 16:15:56 UTC 2012
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)
More information about the svn-src-user
mailing list