From 2cce342a391dc109c2235c33d3e69a07dbf98522 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Thu, 26 May 2011 11:47:23 +0430 Subject: [PATCH] cpp: fix handling comments and strings inside macros --- cpp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cpp.c b/cpp.c index 57a9075..f2df617 100644 --- a/cpp.c +++ b/cpp.c @@ -208,12 +208,16 @@ static void read_tilleol(char *dst) int last = cur; if (buf[cur] == '\\' && buf[cur + 1] == '\n') { cur += 2; - } else if (jumpcomment()) { - *dst++ = buf[cur++]; - } else if (jumpstr()) { + continue; + } + if (!jumpstr()) { memcpy(dst, buf + last, cur - last); dst += cur - last; + continue; } + if (!jumpcomment()) + continue; + *dst++ = buf[cur++]; } *dst = '\0'; } -- 2.11.4.GIT