include $(PKGROOT)/Include
PKG_NAME = patch
-PKG_VER = 2.6.1
+PKG_VER = 2.6.1.28-d909
PKG_REL = 0
PKG_MAINTAINER =
--- /dev/null
+diff -up patch-2.6/src/inp.c.sigsegv patch-2.6/src/inp.c
+--- patch-2.6/src/inp.c.sigsegv 2009-11-02 19:09:57.000000000 +0000
++++ patch-2.6/src/inp.c 2009-11-16 09:31:52.305022200 +0000
+@@ -77,6 +77,14 @@ re_input (void)
+ }
+ }
+
++void
++reset_scan_input_vars()
++{
++ using_plan_a = 1;
++ i_buffer = NULL;
++ i_ptr = NULL;
++}
++
+ /* Construct the line index, somehow or other. */
+
+ void
+diff -up patch-2.6/src/inp.h.sigsegv patch-2.6/src/inp.h
+--- patch-2.6/src/inp.h.sigsegv 2009-11-02 19:09:57.000000000 +0000
++++ patch-2.6/src/inp.h 2009-11-16 09:32:24.440021838 +0000
+@@ -24,4 +24,5 @@ XTERN LINENUM input_lines; /* how long
+ char const *ifetch (LINENUM, bool, size_t *);
+ void get_input_file (char const *, char const *);
+ void re_input (void);
++void reset_scan_input_vars (void);
+ void scan_input (char *);
+diff -up patch-2.6/src/patch.c.sigsegv patch-2.6/src/patch.c
+--- patch-2.6/src/patch.c.sigsegv 2009-11-02 19:09:57.000000000 +0000
++++ patch-2.6/src/patch.c 2009-11-16 09:31:52.306021801 +0000
+@@ -210,7 +210,10 @@ main (int argc, char **argv)
+
+ /* find out where all the lines are */
+ if (!skip_rest_of_patch)
+- scan_input (inname);
++ scan_input (inname);
++ else
++ reset_scan_input_vars ();
++
+
+ /* from here on, open no standard i/o files, because malloc */
+ /* might misfire and we can't catch it easily */
+++ /dev/null
-Submitted by: Matt Burgess <matthew at linuxfromscratch.org>
-Date: 2010-01-03
-Initial Package Version: 2.6.1
-Upstream Status: Submitted
-Origin: Matt Burgess
-Description: Prevents a test from failing when ed is not available.
-
-diff -Naur patch-2.6.1.orig/tests/crlf-handling patch-2.6.1/tests/crlf-handling
---- patch-2.6.1.orig/tests/crlf-handling 2009-12-30 12:56:30.000000000 +0000
-+++ patch-2.6.1/tests/crlf-handling 2010-01-03 11:06:00.340849916 +0000
-@@ -89,10 +89,14 @@
-
- # --------------------------------------------------------------
-
--diff -e a b > ab.diff
--cp a c
--check 'patch c < ab.diff' <<EOF
-+if ! have_ed ; then
-+ echo "The ed utility is not available; skipping ed related tests"
-+else
-+ diff -e a b > ab.diff
-+ cp a c
-+ check 'patch c < ab.diff' <<EOF
- EOF
-+fi
-
- check 'cat -A c' <<EOF
- 1b^M$
--- /dev/null
+diff -up patch-2.6/src/inp.c.sigsegv patch-2.6/src/inp.c
+--- patch-2.6/src/inp.c.sigsegv 2009-11-02 19:09:57.000000000 +0000
++++ patch-2.6/src/inp.c 2009-11-16 09:31:52.305022200 +0000
+@@ -77,6 +77,14 @@ re_input (void)
+ }
+ }
+
++void
++reset_scan_input_vars()
++{
++ using_plan_a = 1;
++ i_buffer = NULL;
++ i_ptr = NULL;
++}
++
+ /* Construct the line index, somehow or other. */
+
+ void
+diff -up patch-2.6/src/inp.h.sigsegv patch-2.6/src/inp.h
+--- patch-2.6/src/inp.h.sigsegv 2009-11-02 19:09:57.000000000 +0000
++++ patch-2.6/src/inp.h 2009-11-16 09:32:24.440021838 +0000
+@@ -24,4 +24,5 @@ XTERN LINENUM input_lines; /* how long
+ char const *ifetch (LINENUM, bool, size_t *);
+ void get_input_file (char const *, char const *);
+ void re_input (void);
++void reset_scan_input_vars (void);
+ void scan_input (char *);
+diff -up patch-2.6/src/patch.c.sigsegv patch-2.6/src/patch.c
+--- patch-2.6/src/patch.c.sigsegv 2009-11-02 19:09:57.000000000 +0000
++++ patch-2.6/src/patch.c 2009-11-16 09:31:52.306021801 +0000
+@@ -210,7 +210,10 @@ main (int argc, char **argv)
+
+ /* find out where all the lines are */
+ if (!skip_rest_of_patch)
+- scan_input (inname);
++ scan_input (inname);
++ else
++ reset_scan_input_vars ();
++
+
+ /* from here on, open no standard i/o files, because malloc */
+ /* might misfire and we can't catch it easily */