]> granicus.if.org Git - flex/commitdiff
scanner: Ignore comment lines in skeleton files.
authorjannick0 <jannick0@users.noreply.github.com>
Sun, 9 Jul 2017 20:36:14 +0000 (22:36 +0200)
committerWill Estes <westes575@gmail.com>
Sat, 15 Jul 2017 22:52:28 +0000 (18:52 -0400)
In skeleton files comments are indicated by leading `%#` and when
directly read in using `flex -S <skeleton.skl>` they should be
ignored. Example: `flex.skl`.

Amending commit 2f21edac99b5efc432417233e6e53326d630e08f which removed
this conditional branch.

src/misc.c

index 39483ea8119ba761523f44271ea1e5bbe7fdff07..9ead2636e91e0d2fae81ee37f8569e16f285ef0e 100644 (file)
@@ -732,7 +732,10 @@ void skelout (void)
                         */
 #define cmd_match(s) (strncmp(buf,(s),strlen(s))==0)
 
-                       if (buf[1] == '%') {
+               if (buf[1] == '#') {
+                       /* %# indicates comment line to be ignored */
+               } 
+               else if (buf[1] == '%') {
                                /* %% is a break point for skelout() */
                                return;
                        }