mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-26 19:33:58 +08:00
fex: handle trailing semicolons
Some .fex files (for instance those for the H6 in sunxi-boards) contain a trailing semicolon on some lines, after the end quote of a string value. This confuses the parser and messes up our "make check" tests, so remove the semicolon both in the parser, but also in the unify-fex test conditioning tool, to make the tests pass. Signed-off-by: Andre Przywara <osp@andrep.de>
This commit is contained in:
parent
edec4d2f6c
commit
a8013395e6
@ -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 == ':') {
|
||||
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user