From 329eb3d9f698a323ba52f94894ae2aec5a6bb10e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 17 Nov 2014 09:07:43 +0100 Subject: fix macro call regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/make-tree.c | 6 +++++- src/mds-kbdc/mds-kbdc.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mds-kbdc/make-tree.c b/src/mds-kbdc/make-tree.c index 5bd2b9e..a32c33b 100644 --- a/src/mds-kbdc/make-tree.c +++ b/src/mds-kbdc/make-tree.c @@ -542,7 +542,7 @@ else if (quote) quote = (c != '"'); \ else if (c == '\"') quote = 1; \ else if (c == '>') triangle = 0; \ - else if ((c == ' ') && !triangle) { arg_end--; break; } \ + else if (IS_END(c) && !triangle) { arg_end--; break; } \ } \ prev_end_char = *arg_end, *arg_end = '\0'; \ fail_if ((node->var = strdup(line)) == NULL); \ @@ -769,6 +769,7 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu continue; prev_end_char = *end, *end = '\0'; original = line; + fprintf(stderr, ":: %zu\n", line_i); redo: if (in_array) @@ -996,11 +997,14 @@ int parse_to_tree(const char* restrict filename, mds_kbdc_tree_t** restrict resu if (prev_end_char) { NEW_NODE(macro_call, MACRO_CALL); + old_end = end, old_prev_end_char = prev_end_char; NO_JUMP; + *old_end = '\0'; CHARS(name); #define inner arguments BRANCH(NULL); #undef inner + end = old_end, prev_end_char = old_prev_end_char; line++; for (;;) { diff --git a/src/mds-kbdc/mds-kbdc.c b/src/mds-kbdc/mds-kbdc.c index dc3327f..34b2002 100644 --- a/src/mds-kbdc/mds-kbdc.c +++ b/src/mds-kbdc/mds-kbdc.c @@ -55,6 +55,7 @@ int main(int argc_, char** argv_) if ((*errors)->severity >= MDS_KBDC_PARSE_ERROR_ERROR) fatal = 1; mds_kbdc_parse_error_print(*errors++, stderr); + errors++; } mds_kbdc_parse_error_free_all(parse_errors); if (fatal) -- cgit v1.2.3-70-g09d2