Keep searching for '#' comment marker if previous occurence was a false positive
authorMichel Alexandre Salim <salimma@fedoraproject.org>
Sat, 19 Mar 2011 11:41:01 +0000 (12:41 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 23:27:47 +0000 (16:27 -0700)
config.c

index 42a0384..e06f480 100644 (file)
--- a/config.c
+++ b/config.c
@@ -355,9 +355,18 @@ void bti_parse_configfile(struct session *session)
                if (line == hashmarker)
                        line[0] = '\0';
                else {
-                       --hashmarker;
-                       if (isblank(hashmarker[0]))
-                               hashmarker[0] = '\0';
+                       while (hashmarker[0] != '\0') {
+                               --hashmarker;
+                               if (isblank(hashmarker[0]))
+                                       hashmarker[0] = '\0';
+                               else {
+                                       /*
+                                        * false positive; '#' occured
+                                        * within a string
+                                        */
+                                       hashmarker = strchrnul(hashmarker+2, '#');
+                               }
+                       }
                }
                c = line;
                while (isspace(*c))