mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-23 01:46:44 +08:00
fex: add support for '-' and '/' characters
Newer fex files like orangepi_oneplus.fex from the sunxi-boards repo fail conversion to the binary format: -------------------------- E: orangepi_oneplus.fex:258: invalid character at 4. -------------------------- This is because they contain a '-' character in section and key names, and also '/' characters in some section names, which our compiler denies. Relax the section and key filter to allow '-' and '/' as well. Signed-off-by: Andre Przywara <osp@andrep.de>
This commit is contained in:
parent
34da6cf5b9
commit
edec4d2f6c
@ -242,7 +242,7 @@ static int decompile_section(void *bin, size_t bin_size,
|
||||
words = (entry->pattern >> 0) & 0xffff;
|
||||
|
||||
for (char *p = entry->name; *p; p++)
|
||||
if (!(isalnum(*p) || *p == '_')) {
|
||||
if (!(isalnum(*p) || *p == '_' || *p == '-')) {
|
||||
pr_info("Warning: Malformed entry key \"%s\"\n",
|
||||
entry->name);
|
||||
break;
|
||||
|
@ -211,7 +211,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 +239,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);
|
||||
|
Loading…
Reference in New Issue
Block a user