]> Shamusworld >> Repos - rmac/commitdiff
Fix for #199 - stop tokenising after the first symbol when inside a disabled code... v2.2.8
authorggn <ggn@atari.org>
Tue, 20 Dec 2022 19:39:51 +0000 (21:39 +0200)
committerShamus Hammons <jlhamm@acm.org>
Wed, 21 Dec 2022 22:05:58 +0000 (16:05 -0600)
token.c

diff --git a/token.c b/token.c
index 89c7f0ab57787beba4ecbdcfe37ffa35ce6043cb..9cbf8b4e0ad8fd5dd613ac6feab5dbb8b0d948b5 100644 (file)
--- a/token.c
+++ b/token.c
@@ -1257,6 +1257,14 @@ DEBUG { printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); }
                        if (stuffnull)  // Arrange for string termination on next pass
                                nullspot = ln;
 
+                       if (disabled)
+                       {
+                               // When we are in a disabled code block, the only thing that can break out
+                               // of this is an ".endif" keyword, so this is the minimum we have to parse
+                               // in order to discover such a keyword.
+                               goto goteol;
+                       }
+
                        continue;
                }