From 055cc019d1dedeb0faa8ca0f55e153e395ad64a1 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Fri, 11 Mar 2016 20:38:16 +1000 Subject: [PATCH] * config : replace parameters in main/defaults sections --- src/config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index a714fe1..2de625d 100644 --- a/src/config.c +++ b/src/config.c @@ -223,16 +223,21 @@ f2b_config_load(f2b_config_t *config, const char *path) { } /* key/value pair */ param = f2b_config_param_create(p); - if (!param) { + if (param && (section->type == t_main || section->type == t_defaults)) { + f2b_config_section_append(section, param, true); + } else if (param) { + f2b_config_section_append(section, param, false); + } else { f2b_log_msg(log_error, "can't parse key/value at line %d: %s", linenum, p); continue; } - f2b_config_section_append(section, param, false); break; } /* switch */ } /* while */ fclose(f); + /* TODO: process includes */ + return true; }