Commit fce71c8d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Allow trailing whitespace in config file.

parent f853a225
...@@ -273,7 +273,7 @@ parse_filter(gnc_t gnc, void *closure) ...@@ -273,7 +273,7 @@ parse_filter(gnc_t gnc, void *closure)
while(c >= 0 && c != '\n') { while(c >= 0 && c != '\n') {
c = skip_whitespace(c, gnc, closure); c = skip_whitespace(c, gnc, closure);
if(c == '#') { if(c == '\n' || c == '#') {
c = skip_to_eol(c, gnc, closure); c = skip_to_eol(c, gnc, closure);
break; break;
} }
...@@ -378,7 +378,7 @@ parse_nconf(gnc_t gnc, void *closure) ...@@ -378,7 +378,7 @@ parse_nconf(gnc_t gnc, void *closure)
goto error; goto error;
c = skip_whitespace(c, gnc, closure); c = skip_whitespace(c, gnc, closure);
if(c < -1 || c == '#') if(c < -1 || c == '\n' || c == '#')
goto error; goto error;
c = getstring(c, &token, gnc, closure); c = getstring(c, &token, gnc, closure);
...@@ -389,8 +389,7 @@ parse_nconf(gnc_t gnc, void *closure) ...@@ -389,8 +389,7 @@ parse_nconf(gnc_t gnc, void *closure)
while(c >= 0 && c != '\n') { while(c >= 0 && c != '\n') {
c = skip_whitespace(c, gnc, closure); c = skip_whitespace(c, gnc, closure);
if(c == '\n' || c == '#') {
if(c == '#') {
c = skip_to_eol(c, gnc, closure); c = skip_to_eol(c, gnc, closure);
break; break;
} }
...@@ -503,14 +502,10 @@ parse_config(gnc_t gnc, void *closure) ...@@ -503,14 +502,10 @@ parse_config(gnc_t gnc, void *closure)
while(c >= 0) { while(c >= 0) {
c = skip_whitespace(c, gnc, closure); c = skip_whitespace(c, gnc, closure);
if(c == '#') { if(c == '\n' || c == '#') {
c = skip_to_eol(c, gnc, closure); c = skip_to_eol(c, gnc, closure);
continue; continue;
} }
if(c == '\n') {
c = gnc(closure);
continue;
}
if(c < 0) if(c < 0)
break; break;
c = getword(c, &token, gnc, closure); c = getword(c, &token, gnc, closure);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment