diff options
Diffstat (limited to 'lib/parse_ini.c')
| -rw-r--r-- | lib/parse_ini.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 873ee8ce..1289aae2 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c | |||
| @@ -42,16 +42,17 @@ typedef struct { | |||
| 42 | 42 | ||
| 43 | static char *default_ini_file_names[] = {"monitoring-plugins.ini", "plugins.ini", "nagios-plugins.ini", NULL}; | 43 | static char *default_ini_file_names[] = {"monitoring-plugins.ini", "plugins.ini", "nagios-plugins.ini", NULL}; |
| 44 | 44 | ||
| 45 | static char *default_ini_path_names[] = {"/usr/local/etc/monitoring-plugins/monitoring-plugins.ini", "/usr/local/etc/monitoring-plugins.ini", | 45 | static char *default_ini_path_names[] = { |
| 46 | "/etc/monitoring-plugins/monitoring-plugins.ini", "/etc/monitoring-plugins.ini", | 46 | "/usr/local/etc/monitoring-plugins/monitoring-plugins.ini", "/usr/local/etc/monitoring-plugins.ini", |
| 47 | /* deprecated path names (for backward compatibility): */ | 47 | "/etc/monitoring-plugins/monitoring-plugins.ini", "/etc/monitoring-plugins.ini", |
| 48 | "/etc/nagios/plugins.ini", "/usr/local/nagios/etc/plugins.ini", "/usr/local/etc/nagios/plugins.ini", "/etc/opt/nagios/plugins.ini", | 48 | /* deprecated path names (for backward compatibility): */ |
| 49 | "/etc/nagios-plugins.ini", "/usr/local/etc/nagios-plugins.ini", "/etc/opt/nagios-plugins.ini", NULL}; | 49 | "/etc/nagios/plugins.ini", "/usr/local/nagios/etc/plugins.ini", "/usr/local/etc/nagios/plugins.ini", "/etc/opt/nagios/plugins.ini", |
| 50 | "/etc/nagios-plugins.ini", "/usr/local/etc/nagios-plugins.ini", "/etc/opt/nagios-plugins.ini", NULL}; | ||
| 50 | 51 | ||
| 51 | /* eat all characters from a FILE pointer until n is encountered */ | 52 | /* eat all characters from a FILE pointer until n is encountered */ |
| 52 | #define GOBBLE_TO(f, c, n) \ | 53 | #define GOBBLE_TO(f, c, n) \ |
| 53 | do { \ | 54 | do { \ |
| 54 | (c) = fgetc((f)); \ | 55 | (c) = fgetc((f)); \ |
| 55 | } while ((c) != EOF && (c) != (n)) | 56 | } while ((c) != EOF && (c) != (n)) |
| 56 | 57 | ||
| 57 | /* internal function that returns the constructed defaults options */ | 58 | /* internal function that returns the constructed defaults options */ |
| @@ -146,7 +147,11 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts) { | |||
| 146 | int c = 0; | 147 | int c = 0; |
| 147 | bool status = false; | 148 | bool status = false; |
| 148 | size_t i, stanza_len; | 149 | size_t i, stanza_len; |
| 149 | enum { NOSTANZA, WRONGSTANZA, RIGHTSTANZA } stanzastate = NOSTANZA; | 150 | enum { |
| 151 | NOSTANZA, | ||
| 152 | WRONGSTANZA, | ||
| 153 | RIGHTSTANZA | ||
| 154 | } stanzastate = NOSTANZA; | ||
| 150 | 155 | ||
| 151 | stanza_len = strlen(stanza); | 156 | stanza_len = strlen(stanza); |
| 152 | 157 | ||
