Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jun 2008 13:22:53 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 143641 for review
Message-ID:  <200806171322.m5HDMrp9046545@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143641

Change 143641 by gabor@gabor_server on 2008/06/17 13:22:05

	- Improve compatibility of -B

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/grep/util.c#23 edit

Differences ...

==== //depot/projects/soc2008/gabor_textproc/grep/util.c#23 (text+ko) ====

@@ -276,7 +276,7 @@
 
 	if ((tail || c) && !cflag && !qflag) {
 		if (c) {
-			if (!first && !prev && !tail && (Aflag || Bflag))
+			if (!first && !prev && !tail && Aflag)
 				printf("--\n");
 			tail = Aflag;
 			if (Bflag > 0)
@@ -284,16 +284,19 @@
 			linesqueued = 0;
 			printline(l, ':');
 		} else {
-			prev = 0;
 			printline(l, '-');
 			tail--;
 		}
 	}
 
+	if (!c && Bflag && prev)
+		printf("--\n");
+
 	if (c) {
 		prev++;
 		first = 0;
-	}
+	} else
+		prev = 0;
 
 	return (c);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806171322.m5HDMrp9046545>