diff options
Diffstat (limited to 'script_fex.c')
-rw-r--r-- | script_fex.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/script_fex.c b/script_fex.c index 0288560..ec251c2 100644 --- a/script_fex.c +++ b/script_fex.c @@ -200,6 +200,10 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script) pe = rtrim(s, pe); + /* Some lines end in a trailing semicolon. */ + if (pe > s && pe[-1] == ';') + *--pe = '\0'; + if (pe == s || *s == ';' || *s == '#') continue; /* empty */ if (*s == ':') { @@ -211,7 +215,7 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script) if (*s == '[') { /* section */ char *p = ++s; - while (isalnum(*p) || *p == '_') + while (isalnum(*p) || *p == '_' || *p == '-' || *p == '/') p++; if (*p == ']' && *(p+1) == '\0') { @@ -239,7 +243,7 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script) goto parse_error; }; - while (isalnum(*p) || *p == '_') + while (isalnum(*p) || *p == '_' || *p == '-') p++; mark = p; p = skip_blank(p); |