summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2008-02-22 00:15:28 +0800
committerGary V. Vaughan <gary@gnu.org>2008-02-22 00:15:28 +0800
commit47f7469edbec86cf88d98f448c58ce1916bab812 (patch)
tree2b042cc44ec4dabc95c2d30a6477c8aa212f3f9f
parentdef1f82375ed7f310bdd8d8e1ce0c2cd9c64e2c6 (diff)
downloadm4-47f7469edbec86cf88d98f448c58ce1916bab812.tar.gz
Fix regression in argument collection, from 2008-01-21.
* m4/input.c (m4__next_token): When DEBUG_INPUT is defined, undo argument collection optimisation for strings, so that m4_print_token doesn't abort when it otherwise receives an unprintable M4_SYMBOL_VOID type token.
-rw-r--r--ChangeLog8
-rw-r--r--m4/input.c9
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b5ae203a..abec5937 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-22 Gary V. Vaughan <gary@gnu.org>
+
+ Fix regression in argument collection, from 2008-01-21.
+ * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
+ undo argument collection optimisation for strings, so that
+ m4_print_token doesn't abort when it otherwise receives an
+ unprintable M4_SYMBOL_VOID type token.
+
2008-02-20 Eric Blake <ebb9@byu.net>
Stage 16: cache quotes and improve m4_arg_print.
diff --git a/m4/input.c b/m4/input.c
index 381f38d5..fdfccc81 100644
--- a/m4/input.c
+++ b/m4/input.c
@@ -1746,6 +1746,15 @@ m4__next_token (m4 *context, m4_symbol_value *token, int *line,
VALUE_MAX_ARGS (token) = -1;
#ifdef DEBUG_INPUT
+ if (token->type == M4_SYMBOL_VOID)
+ {
+ len = obstack_object_size (&token_stack);
+ obstack_1grow (&token_stack, '\0');
+
+ m4_set_symbol_value_text (token, obstack_finish (&token_stack), len,
+ m4__quote_age (M4SYNTAX));
+ }
+
m4_print_token (context, "next_token", type, token);
#endif