diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 57321753c5b0bff692d4b621d82de2eee7336ae4..004396fe803378c18c501bb17743364b8cb6508b 100644 (file)
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
* License: GPL
* Copyright (c) 2007 Nagios Plugins Development Team
*
-* Last Modified: $Date$
-*
-*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-* $Id$
*
*****************************************************************************/
@@ -79,10 +75,13 @@ static void parse_locator(const char *locator, const char *def_stanza, np_ini_in
/* if there is no @file part */
if(stanza_len==locator_len){
i->file=default_file();
+ if(strcmp(i->file, "") == 0){
+ die(STATE_UNKNOWN, _("Cannot find '%s' or '%s' in any standard location.\n"), NP_DEFAULT_INI_FILENAME1, NP_DEFAULT_INI_FILENAME2);
+ }
} else {
i->file=strdup(&(locator[stanza_len+1]));
}
-
+
if(i->file==NULL || i->stanza==NULL){
die(STATE_UNKNOWN, _("malloc() failed!\n"));
}
if(inifile!=stdin) fclose(inifile);
}
free(i.stanza);
- return defaults;
+ return defaults;
}
/* read_defaults is where the meat of the parsing takes place.
default:
switch(stanzastate){
/* we never found the start of the first stanza, so
- * we're dealing with a config error
+ * we're dealing with a config error
*/
case NOSTANZA:
die(STATE_UNKNOWN, _("Config file error"));