fexc: Ignore lines starting with ':' when compiling .fex

Such lines do not conform to any known syntax rules.

With this patch, fexc will assume that they represent a special
case (where bin2fex extracted a malformed indentifier from a .bin
file - likely a remnant from a comment typo), issue a warning and
ignore the line.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
This commit is contained in:
Bernhard Nortmann 2016-05-26 08:20:19 +02:00
parent 80aae9268a
commit 7a0a7012c6

View File

@ -202,7 +202,13 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script)
if (pe == s || *s == ';' || *s == '#')
continue; /* empty */
else if (*s == '[') {
if (*s == ':') {
/* see https://github.com/linux-sunxi/sunxi-boards/issues/50 */
errf("Warning: %s:%zu: invalid line, suspecting typo/malformed comment.\n",
filename, line);
continue; /* ignore this line */
}
if (*s == '[') {
/* section */
char *p = ++s;
while (isalnum(*p) || *p == '_')