From 51ec51a8dcbe003a0fe5cd0ad1d78f5590f5d40f Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Tue, 4 Nov 2008 17:41:53 +0000 Subject: Make extra-opts (C plugins) behave more like N::P: N::P allows both '#' and ';' for comments. Extra-opts used to allow only '#', it now allows both (';' is the standard for ini files) Extra-opts does not allow trailing comments anymore (like N::P) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2063 f882894a-f735-0410-b71e-b25c423dba1c --- lib/parse_ini.c | 7 +++---- lib/tests/plugin.ini | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 654452d8..57321753 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){ if(isspace(c)) continue; switch(c){ /* globble up coment lines */ + case ';': case '#': GOBBLE_TO(f, c, '\n'); break; @@ -232,10 +233,8 @@ static int add_option(FILE *f, np_arg_list **optlst){ if(optptr==eqptr) die(STATE_UNKNOWN, _("Config file error\n")); /* continue from '=' to start of value or EOL */ for(valptr=eqptr+1; valptr