diff options
Diffstat (limited to 'lib/parse_ini.c')
-rw-r--r-- | lib/parse_ini.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 654452d..5732175 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c | |||
@@ -132,6 +132,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){ | |||
132 | if(isspace(c)) continue; | 132 | if(isspace(c)) continue; |
133 | switch(c){ | 133 | switch(c){ |
134 | /* globble up coment lines */ | 134 | /* globble up coment lines */ |
135 | case ';': | ||
135 | case '#': | 136 | case '#': |
136 | GOBBLE_TO(f, c, '\n'); | 137 | GOBBLE_TO(f, c, '\n'); |
137 | break; | 138 | break; |
@@ -232,10 +233,8 @@ static int add_option(FILE *f, np_arg_list **optlst){ | |||
232 | if(optptr==eqptr) die(STATE_UNKNOWN, _("Config file error\n")); | 233 | if(optptr==eqptr) die(STATE_UNKNOWN, _("Config file error\n")); |
233 | /* continue from '=' to start of value or EOL */ | 234 | /* continue from '=' to start of value or EOL */ |
234 | for(valptr=eqptr+1; valptr<lineend && isspace(*valptr); valptr++); | 235 | for(valptr=eqptr+1; valptr<lineend && isspace(*valptr); valptr++); |
235 | /* continue to the end of value (FIXME: watching for trailing comments) */ | 236 | /* continue to the end of value */ |
236 | for(valend=valptr; valend<lineend; valend++) | 237 | for(valend=valptr; valend<lineend; valend++); |
237 | /* FIXME: N::P doesn't allow comments here. Remove next line and parse_ini won't either */ | ||
238 | if(*valend=='#') break; | ||
239 | --valend; | 238 | --valend; |
240 | /* Finally trim off trailing spaces */ | 239 | /* Finally trim off trailing spaces */ |
241 | for(valend; isspace(*valend); valend--); | 240 | for(valend; isspace(*valend); valend--); |