From 770e529b2033ebe5e0fe26f8d2f41d674080f928 Mon Sep 17 00:00:00 2001 From: acqn Date: Thu, 1 Sep 2022 12:58:52 +0800 Subject: [PATCH] Fixed newline counting inside old C style comments. --- src/cc65/preproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cc65/preproc.c b/src/cc65/preproc.c index 4ae41252b..87d6a7878 100644 --- a/src/cc65/preproc.c +++ b/src/cc65/preproc.c @@ -878,7 +878,7 @@ static void Stringize (StrBuf* Source, StrBuf* Target) static void OldStyleComment (void) -/* Remove an old style C comment from line. */ +/* Remove an old style C comment from line */ { /* Remember the current line number, so we can output better error ** messages if the comment is not terminated in the current file. @@ -897,6 +897,7 @@ static void OldStyleComment (void) StartingLine); return; } + ++PendingNewLines; } else { if (CurC == '/' && NextC == '*') { PPWarning ("'/*' found inside a comment"); @@ -913,7 +914,7 @@ static void OldStyleComment (void) static void NewStyleComment (void) -/* Remove a new style C comment from line. */ +/* Remove a new style C comment from line */ { /* Diagnose if this is unsupported */ if (IS_Get (&Standard) < STD_C99) {