memcpy (buffer_start, BEFORE_STRING, (int) BEFORE_SIZE);
}
+/* Finish off old buffers. */
+
+static void
+input_scrub_free (void)
+{
+ if (sb_index != (size_t) -1)
+ {
+ sb_kill (&from_sb);
+ sb_index = -1;
+ }
+ free (buffer_start);
+ buffer_start = NULL;
+ input_file_end ();
+}
+
/* Push the state of input reading and scrubbing so that we can #include.
The return value is a 'void *' (fudged for old compilers) to a save
area, which can be restored by passing it to input_scrub_pop(). */
{
char *saved_position;
- input_scrub_end (); /* Finish off old buffer */
+ input_scrub_free ();
input_file_pop (saved->input_file_save);
saved_position = saved->saved_position;
void
input_scrub_end (void)
{
- if (buffer_start)
- {
- free (buffer_start);
- buffer_start = 0;
- input_file_end ();
- }
+ while (next_saved_file != NULL)
+ input_scrub_pop (next_saved_file);
+ input_scrub_free ();
}
/* Start reading input from a new file.
{
if (sb_index >= from_sb.len)
{
- sb_kill (&from_sb);
if (from_sb_expansion == expanding_macro)
{
cond_finish_check (macro_nest);