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:
committed by
Michael Stapelberg
parent
82b59788ac
commit
7f5a18e093
@ -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') {
|
||||
|
Reference in New Issue
Block a user