From: Timo Sirainen Date: Tue, 29 Jul 2025 11:31:04 +0000 (+0300) Subject: config: config_get_value() - Add filter_parser parameter X-Git-Tag: 2.4.2~591 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96294d6d9548e83805a1a18a1b60dd75ad38eed8;p=thirdparty%2Fdovecot%2Fcore.git config: config_get_value() - Add filter_parser parameter --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 4b258882e9..b836816ce9 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -2417,12 +2417,12 @@ config_parse_finish(struct config_parser_context *ctx, } static bool -config_get_value(struct config_section_stack *section, +config_get_value(struct config_filter_parser *filter_parser, struct config_parser_key *config_key, const char *key, string_t *str) { struct config_module_parser *l = - §ion->filter_parser->module_parsers[config_key->info_idx]; + &filter_parser->module_parsers[config_key->info_idx]; const struct setting_define *def = &l->info->defines[config_key->define_idx]; if (def->type == SET_STRLIST || def->type == SET_BOOLLIST || @@ -2434,7 +2434,7 @@ config_get_value(struct config_section_stack *section, str_append(str, l->settings[config_key->define_idx].str); return TRUE; } - if (section->prev == NULL) { + if (filter_parser->parent == NULL) { /* use the default setting */ const void *value = CONST_PTR_OFFSET(l->info->defaults, def->offset); @@ -2444,7 +2444,7 @@ config_get_value(struct config_section_stack *section, } /* not changed by this parser. maybe parent has. */ - return config_get_value(section->prev, config_key, key, str); + return config_get_value(filter_parser->parent, config_key, key, str); } static int config_write_keyvariable(struct config_parser_context *ctx, @@ -2490,8 +2490,8 @@ static int config_write_keyvariable(struct config_parser_context *ctx, set_name, NULL); return -1; } - if (!config_get_value(ctx->cur_section, config_key, - set_name, str)) { + if (!config_get_value(ctx->cur_section->filter_parser, + config_key, set_name, str)) { ctx->error = p_strdup_printf(ctx->pool, "Failed to expand $SET:%s: " "Setting type can't be expanded to string",