Package-Name: patch
Gentoo-Package: sys-devel/patch
Requires: glibc
Compile-Requires: gcc binutils make
Homepage: http://www.gnu.org/software/patch/
Source: gnu:///patch/patch-(\d+.\d+(.\d+)?).tar.gz $1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	cp -p AUTHORS COPYING ChangeLog* NEWS README "$(PREFIX)/"
	$(MAKE) -f ../Makefile configure
	$(MAKE)
	$(MAKE) install
Install:
	$(MAKE) instbin BIN=patch
	$(MAKE) instman SECTION=1 MAN=patch
Patch: <<EOT
######## begin patch to keep offsets from bouncing around
--- patch.c.old	1999-08-30 15:20:08 +0900
+++ patch.c	2006-04-22 18:07:03 +0900
@@ -884,7 +884,7 @@
 	    && offset <= max_pos_offset
 	    && patch_match (first_guess, offset, (LINENUM) 0, suffix_fuzz))
 	  {
-	    last_offset = offset;
+	    last_offset += offset;
 	    return first_guess + offset;
 	  }
 	else
@@ -898,7 +898,7 @@
 	if (offset <= max_neg_offset
 	    && patch_match (first_guess, -offset, prefix_fuzz, (LINENUM) 0))
 	  {
-	    last_offset = - offset;
+	    last_offset -= offset;
 	    return first_guess - offset;
 	  }
 	else
@@ -914,7 +914,7 @@
 	      say ("Offset changing from %s to %s\n",
 		   format_linenum (numbuf0, last_offset),
 		   format_linenum (numbuf1, offset));
-	    last_offset = offset;
+	    last_offset += offset;
 	    return first_guess+offset;
 	}
 	if (0 < offset && offset <= max_neg_offset
@@ -923,7 +923,7 @@
 	      say ("Offset changing from %s to %s\n",
 		   format_linenum (numbuf0, last_offset),
 		   format_linenum (numbuf1, -offset));
-	    last_offset = -offset;
+	    last_offset -= offset;
 	    return first_guess-offset;
 	}
     }
######## end patch to keep offsets from bouncing around
EOT

/pkg/patch/
/usr/bin/patch
/usr/man/man1/patch.1.gz
