patch/patch-2.5.4-sigsegv.patch
2009-11-16 10:05:01 +00:00

43 lines
1.3 KiB
Diff

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 */