aboutsummaryrefslogtreecommitdiffhomepage
path: root/c
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-11-08 12:45:48 +0100
committer lemon<lsof@mailbox.org>2025-11-08 12:45:48 +0100
commit306b64b519287de16e640976e4353deed62baea8 (patch)
treeb35bd571ad3e59443472bd4ed67cd38dbda04448 /c
parent27581faf3d34ec06e3256d967d27888121943898 (diff)
lex: fix single-line comment eating up preprocessor directive in next line
Diffstat (limited to 'c')
-rw-r--r--c/lex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/lex.c b/c/lex.c
index 06457c5..eab9ce3 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -479,7 +479,7 @@ Begin:
if (match(lx, '=')) RET(TKSETDIV);
if (match(lx, '/')) {
/* // comment */
- while (!lx->eof && !match(lx, '\n'))
+ while (!lx->eof && peek(lx, 0) != '\n')
next(lx);
goto Begin;
}