update the configuration file reader to ignore semi-colons
authoraland <aland>
Tue, 5 Sep 2000 14:40:22 +0000 (14:40 +0000)
committeraland <aland>
Tue, 5 Sep 2000 14:40:22 +0000 (14:40 +0000)
src/lib/token.c
src/main/conffile.c

index f0a6b04..ebe1dac 100644 (file)
@@ -38,6 +38,7 @@ static const TOKEN tokens[] = {
        { "<=", T_OP_LE,        },
        { "<",  T_OP_LT,        },
        { "#",  T_HASH,         },
+       { ";",  T_SEMICOLON,    },
        { NULL, 0,              },
 };
 
index b9a5430..d53352e 100644 (file)
@@ -370,7 +370,6 @@ static CONF_SECTION *cf_section_read(const char *cf, int *lineno, FILE *fp,
                /*
                 * Perhaps a subsection.
                 */
-
                if (t2 == T_LCBRACE || t3 == T_LCBRACE) {
                        css = cf_section_read(cf, lineno, fp, buf1,
                                              t2==T_LCBRACE ? NULL : buf2, cs);
@@ -384,6 +383,11 @@ static CONF_SECTION *cf_section_read(const char *cf, int *lineno, FILE *fp,
                }
 
                /*
+                *      Ignore semi-colons.
+                */
+               if (*buf2 == ';') *buf2 = '\0';
+
+               /*
                 *      Must be a normal attr = value line.
                 */
                if (buf1[0] != 0 && buf2[0] == 0 && buf3[0] == 0) {