Module Name: src
Committed By: dholland
Date: Tue Sep 28 00:54:04 UTC 2010
Modified Files:
src/gnu/dist/grep/src: grep.c
Log Message:
Fix -o behavior with patterns that match the empty string, as per PR 43896.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/gnu/dist/grep/src/grep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/gnu/dist/grep/src/grep.c
diff -u src/gnu/dist/grep/src/grep.c:1.12 src/gnu/dist/grep/src/grep.c:1.13
--- src/gnu/dist/grep/src/grep.c:1.12 Thu Aug 28 03:59:06 2008
+++ src/gnu/dist/grep/src/grep.c Tue Sep 28 00:54:04 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: grep.c,v 1.12 2008/08/28 03:59:06 lukem Exp $ */
+/* $NetBSD: grep.c,v 1.13 2010/09/28 00:54:04 dholland Exp $ */
/* grep.c - main driver file for grep.
Copyright 1992, 1997-1999, 2000 Free Software Foundation, Inc.
@@ -542,7 +542,10 @@
if (b == lim)
break;
if (match_size == 0)
- break;
+ {
+ beg++;
+ continue;
+ }
if(color_option)
printf("\33[%sm", grep_color);
fwrite(b, sizeof (char), match_size, stdout);