diff options
-rw-r--r-- | script_fex.c | 4 | ||||
-rw-r--r-- | tests/unify-fex.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/script_fex.c b/script_fex.c index 2c840d4..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 == ':') { diff --git a/tests/unify-fex.c b/tests/unify-fex.c index a1ff548..57da1c2 100644 --- a/tests/unify-fex.c +++ b/tests/unify-fex.c @@ -127,6 +127,10 @@ int main(int argc, char **argv) sprintf(p, "\"%s\"", c); free(c); } + /* Remove a trailing semicolon. */ + c = strchr(p, 0); + if (*--c == ';') + *c = '\0'; } } } |