Add 'line' as a configuration parsing primitive

…and use it for ignoring comment lines, so that quotes in them
doesn't cause problems anymore.
This commit is contained in:
Eelis van der Weegen
2013-04-01 14:42:41 +02:00
committed by Michael Stapelberg
parent 82b59788ac
commit 7f5a18e093
2 changed files with 14 additions and 4 deletions

View File

@ -446,6 +446,16 @@ struct ConfigResult *parse_config(const char *input, struct context *context) {
}
}
if (strcmp(token->name, "line") == 0) {
while (*walk != '\0' && *walk != '\n' && *walk != '\r')
walk++;
next_state(token);
token_handled = true;
linecnt++;
walk++;
break;
}
if (strcmp(token->name, "end") == 0) {
//printf("checking for end: *%s*\n", walk);
if (*walk == '\0' || *walk == '\n' || *walk == '\r') {