+2001-08-27 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/output.c (output): Remove the initialization of the macro
+ obstack. It was done too late here.
+
+ * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
+ completely wrong.
+ (reader): Initialize the macro obstack here, since we need it to grow
+ '%define' directives.
+
+ * src/reader.h: Declare the macro obstack as extern.
+
2001-08-27 Robert Anisko <robert.anisko@epita.fr>
* src/output.c (output_parser): Fix. Store single '%' characters in
int ch = ungetc (skip_white_space (), finput);
char* macro_key;
char* macro_value;
- struct obstack macro_obstack;
-
- obstack_init (¯o_obstack);
/* Read key. */
if (!isalpha (ch) && ch != '_')
return;
}
copy_identifier (finput, ¯o_obstack);
+ obstack_1grow (¯o_obstack, 0);
macro_key = obstack_finish (¯o_obstack);
/* Read value. */
else
fatal (_("Premature EOF after %s"), "\"");
}
- copy_string (finput, ¯o_obstack, '"');
+ copy_string2 (finput, ¯o_obstack, '"', 0);
+ obstack_1grow (¯o_obstack, 0);
macro_value = obstack_finish (¯o_obstack);
- obstack_free (¯o_obstack, 0);
-
/* Store the (key, value) pair in the environment. */
macro_insert (macro_key, macro_value);
}
init_lex ();
lineno = 1;
+ /* Initialize the macro obstack. */
+ obstack_init (¯o_obstack);
+
/* Initialize the symbol table. */
tabinit ();