diff options
Diffstat (limited to 'src/defaults.c')
| -rw-r--r-- | src/defaults.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/defaults.c b/src/defaults.c index 08dc59f..455a07f 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -171,24 +171,6 @@ defaults_get_map_config(const char *mapname, const char **disallowed_chars) { unsigned int i; - if (secure) { - *secure = DEFAULT_MAP_SECURE; - } - if (filter) { - *filter = DEFAULT_ENTRY_FILTER; - } - if (key_format) { - *key_format = DEFAULT_KEY_FORMAT; - } - if (keys_format) { - *keys_format = DEFAULT_KEYS_FORMAT; - } - if (value_format) { - *value_format = DEFAULT_VALUE_FORMAT; - } - if (disallowed_chars) { - *disallowed_chars = DEFAULT_DISALLOWED_CHARS; - } for (i = 0; i < sizeof(config) / sizeof(config[0]); i++) { bool_t match; match = FALSE; @@ -205,6 +187,9 @@ defaults_get_map_config(const char *mapname, } break; } + if (!match) { + continue; + } if (secure) { *secure = config[i].secure; } @@ -223,5 +208,26 @@ defaults_get_map_config(const char *mapname, if (disallowed_chars) { *disallowed_chars = config[i].disallowed_chars; } + break; + } + if (i >= (sizeof(config) / sizeof(config[0]))) { + if (secure) { + *secure = DEFAULT_MAP_SECURE; + } + if (filter) { + *filter = DEFAULT_ENTRY_FILTER; + } + if (key_format) { + *key_format = DEFAULT_KEY_FORMAT; + } + if (keys_format) { + *keys_format = DEFAULT_KEYS_FORMAT; + } + if (value_format) { + *value_format = DEFAULT_VALUE_FORMAT; + } + if (disallowed_chars) { + *disallowed_chars = DEFAULT_DISALLOWED_CHARS; + } } } |
