projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a06b55
)
fix some parser glitches
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 31 Jul 2008 01:07:29 +0000
(
03:07
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 31 Jul 2008 01:07:29 +0000
(
03:07
+0200)
file.c
patch
|
blob
|
history
diff --git
a/file.c
b/file.c
index 19c6b07d6eb04b58e546b672fc6c9c119fdf5ef6..ae0008f40f0185cd3e2d4916002c95453f079df2 100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-186,19
+186,27
@@
static void uci_parse_line(struct uci_context *ctx, bool single)
case 'p':
if ((word[1] == 0) || !strcmp(word + 1, "ackage"))
uci_parse_package(ctx, &word, single);
case 'p':
if ((word[1] == 0) || !strcmp(word + 1, "ackage"))
uci_parse_package(ctx, &word, single);
+ else
+ goto invalid;
break;
case 'c':
if ((word[1] == 0) || !strcmp(word + 1, "onfig"))
uci_parse_config(ctx, &word);
break;
case 'c':
if ((word[1] == 0) || !strcmp(word + 1, "onfig"))
uci_parse_config(ctx, &word);
+ else
+ goto invalid;
break;
case 'o':
if ((word[1] == 0) || !strcmp(word + 1, "ption"))
uci_parse_option(ctx, &word);
break;
case 'o':
if ((word[1] == 0) || !strcmp(word + 1, "ption"))
uci_parse_option(ctx, &word);
+ else
+ goto invalid;
break;
default:
break;
default:
- uci_parse_error(ctx, word, "unterminated command");
- break;
+ goto invalid;
}
}
+ continue;
+invalid:
+ uci_parse_error(ctx, word, "invalid command");
} while (1);
}
} while (1);
}