From 65ff09a9d8159f36b135de98b03f288fda95b1a0 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 4 Mar 2012 13:05:55 +0400 Subject: [PATCH] BR3392200: preproc - Fix dangling paste term Backport 99a055add917fe954038885d9013f8968f76790c Signed-off-by: Cyrill Gorcunov --- preproc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/preproc.c b/preproc.c index 0dab8f28..ac39bb1b 100644 --- a/preproc.c +++ b/preproc.c @@ -3678,8 +3678,13 @@ static bool paste_tokens(Token **head, const struct tokseq_match *m, while (t && (t->type == TOK_WHITESPACE || t->type == TOK_PASTE)) t = *tail = delete_Token(t); - if (!paste_head || !t) - break; /* Nothing to paste with */ + if (!t) { /* Dangling %+ term */ + if (paste_head) + (*paste_head)->next = NULL; + else + *head = NULL; + return did_paste; + } tail = paste_head; t = *tail; tt = t->next; -- 2.11.4.GIT