From: Felix Fietkau Date: Sun, 3 Feb 2008 01:56:41 +0000 (+0100) Subject: parse comments properly X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=commitdiff_plain;h=60d40fa1a8c366ae7a9db2082720395d3dc7c7d8 parse comments properly --- diff --git a/file.c b/file.c index 23ea959..4b607f8 100644 --- a/file.c +++ b/file.c @@ -210,6 +210,9 @@ static void parse_str(struct uci_context *ctx, char **str, char **target) case '"': parse_double_quote(ctx, str, target); break; + case '#': + **str = 0; + /* fall through */ case 0: goto done; case '\\': @@ -451,6 +454,8 @@ static void uci_parse_line(struct uci_context *ctx, bool single) word = strtok_r(word, " \t", &pbrk); switch(word[0]) { + case '#': + return; case 'p': if ((word[1] == 0) || !strcmp(word + 1, "ackage")) uci_parse_package(ctx, &word, single);