diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-31 00:04:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-31 00:04:38 +0900 |
| commit | 76b0c6bb6bbc339789943ada1f79ec1eba52239f (patch) | |
| tree | 083f3a6a8f6bb8275b5c6f9bb6a4c12d22b175ee /src/preprocess.c | |
| parent | 75193c09f1dfcb3c7c726e5492f973a43402e270 (diff) | |
| download | ducc-76b0c6bb6bbc339789943ada1f79ec1eba52239f.tar.gz ducc-76b0c6bb6bbc339789943ada1f79ec1eba52239f.tar.zst ducc-76b0c6bb6bbc339789943ada1f79ec1eba52239f.zip | |
fix: #else/#endif with trailing whitespace or comment
Diffstat (limited to 'src/preprocess.c')
| -rw-r--r-- | src/preprocess.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/preprocess.c b/src/preprocess.c index 6923367..c2dd3a8 100644 --- a/src/preprocess.c +++ b/src/preprocess.c @@ -1084,6 +1084,7 @@ static BOOL preprocess_elif_groups_opt(Preprocessor* pp, BOOL did_include) { // '#' 'else' group? static void preprocess_else_group(Preprocessor* pp, BOOL did_include) { skip_pp_token(pp, TokenKind_pp_directive_else); + skip_whitespaces(pp); expect_pp_token(pp, TokenKind_newline); include_conditionally(pp, GroupDelimiterKind_after_else_directive, !did_include); @@ -1093,6 +1094,7 @@ static void preprocess_else_group(Preprocessor* pp, BOOL did_include) { // '#' 'endif' new-line static void preprocess_endif_directive(Preprocessor* pp) { skip_pp_token(pp, TokenKind_pp_directive_endif); + skip_whitespaces(pp); expect_pp_token(pp, TokenKind_newline); } |
