Bug report: #14693 Reported by: Vincent Renardias Patch: jdassen@wi.leidenuniv.nl (J.H.M.Dassen) Since Version: 2.5-2 --- patch-2.5.orig/inp.c +++ patch-2.5/inp.c @@ -71,6 +71,14 @@ } } +void +reset_scan_input_vars() +{ + using_plan_a = 1; + i_buffer = NULL; + i_ptr = NULL; +} + /* Construct the line index, somehow or other. */ void --- patch-2.5.orig/patch.c +++ patch-2.5/patch.c @@ -210,7 +210,10 @@ /* 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 */ --- patch-2.5.orig/inp.h +++ patch-2.5/inp.h @@ -7,4 +7,5 @@ char const *ifetch PARAMS ((LINENUM, int, size_t *)); void get_input_file PARAMS ((char const *, char const *)); void re_input PARAMS ((void)); +void reset_scan_input_vars PARAMS (()); void scan_input PARAMS ((char *));