From a05278ae05df910e6a3a450d862fc1b53f138eb7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 31 Jul 2008 03:07:29 +0200 Subject: [PATCH 1/1] fix some parser glitches --- file.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/file.c b/file.c index 19c6b07..ae0008f 100644 --- 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); + else + goto invalid; 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); + else + goto invalid; break; default: - uci_parse_error(ctx, word, "unterminated command"); - break; + goto invalid; } + continue; +invalid: + uci_parse_error(ctx, word, "invalid command"); } while (1); } -- 2.11.0