Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/grep/src Fix -o behavior with patterns that match t...



details:   https://anonhg.NetBSD.org/src/rev/c501c2757cab
branches:  trunk
changeset: 757853:c501c2757cab
user:      dholland <dholland%NetBSD.org@localhost>
date:      Tue Sep 28 00:54:04 2010 +0000

description:
Fix -o behavior with patterns that match the empty string, as per PR 43896.

diffstat:

 gnu/dist/grep/src/grep.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r effcc5001493 -r c501c2757cab gnu/dist/grep/src/grep.c
--- a/gnu/dist/grep/src/grep.c  Tue Sep 28 00:39:56 2010 +0000
+++ b/gnu/dist/grep/src/grep.c  Tue Sep 28 00:54:04 2010 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index