summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47fddad)
raw | patch | inline | side by side (parent: 47fddad)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Tue, 4 Nov 2008 17:41:53 +0000 (17:41 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Tue, 4 Nov 2008 17:41:53 +0000 (17:41 +0000) |
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
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
NEWS | patch | blob | history | |
lib/parse_ini.c | patch | blob | history | |
lib/tests/plugin.ini | patch | blob | history |
index 0156701730e5fc3de6be572ae0ce35ff451fae77..42eb761e560e570528e36cd6ba846981862518e7 100644 (file)
--- a/NEWS
+++ b/NEWS
check_ifoperstatus -n flag now works as expected (sf.net #1569488)
check_ifoperstatus now supports ifType based lookup for ifIndex
check_ups now sends a LOGOUT string (debian bug #387001)
+ Extra-opts (C plugins) now allows both '#' and ';' for comments (like N::P)
+ Extra-opts (C plugins) does not allow trailing comments anymore (like N::P)
1.4.13 25th Sept 2008
Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen)
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 654452d8cd286dd6fbe0dfec4f5a3fd0052148a8..57321753c5b0bff692d4b621d82de2eee7336ae4 100644 (file)
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
if(isspace(c)) continue;
switch(c){
/* globble up coment lines */
+ case ';':
case '#':
GOBBLE_TO(f, c, '\n');
break;
if(optptr==eqptr) die(STATE_UNKNOWN, _("Config file error\n"));
/* continue from '=' to start of value or EOL */
for(valptr=eqptr+1; valptr<lineend && isspace(*valptr); valptr++);
- /* continue to the end of value (FIXME: watching for trailing comments) */
- for(valend=valptr; valend<lineend; valend++)
- /* FIXME: N::P doesn't allow comments here. Remove next line and parse_ini won't either */
- if(*valend=='#') break;
+ /* continue to the end of value */
+ for(valend=valptr; valend<lineend; valend++);
--valend;
/* Finally trim off trailing spaces */
for(valend; isspace(*valend); valend--);
diff --git a/lib/tests/plugin.ini b/lib/tests/plugin.ini
index e22f8bdb309e2ceb7719f56c9e626dc58f16df04..511fd9f6c09b4780230e020cde5132964e431fc4 100644 (file)
--- a/lib/tests/plugin.ini
+++ b/lib/tests/plugin.ini
+# Non-standard (but accepted) comment
+; standard ini comment
[check_mysql]
username=operator
-password=secret # Remember to change later
+; comment in the middle
+password=secret
[section_twice]
foo=bar