Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 8240841f74f568992adb32a307b1c376 > files > 14

grep-2.5.1-55.el5.src.rpm

2009-01-26  Stepan Kasal  <skasal@redhat.com>

	* src/grep.c (prpending) fix off-by-one error in the execute call;
	also in upstream, see https://savannah.gnu.org/patch/?3840


--- grep-2.5.1/src/grep.c	2009-01-26 15:31:11.404091000 +0100
+++ grep-2.5.1/src/grep.c	2009-01-26 16:29:42.821903000 +0100
@@ -635,7 +635,7 @@
       size_t match_size;
       --pending;
       if (outleft
-	  || (((*execute) (lastout, nl - lastout, &match_size, 0) == (size_t) -1)
+	  || (((*execute) (lastout, nl + 1 - lastout, &match_size, 0) == (size_t) -1)
 	      == !out_invert))
 	prline (lastout, nl + 1, '-');
       else