From: Timo Sirainen Date: Fri, 2 Feb 2024 07:49:21 +0000 (+0200) Subject: config: Move config_apply_error() ealier X-Git-Tag: 2.4.1~1078 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad5c1eab7c3942549b491b3c0b8c7ed686b2f3d6;p=thirdparty%2Fdovecot%2Fcore.git config: Move config_apply_error() ealier --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 0b39a1faf9..0b3b4463db 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -304,6 +304,28 @@ fix_relative_path(const char *path, struct input_stack *input) return t_strconcat(t_strdup_until(input->path, p+1), path, NULL); } +static int +config_apply_error(struct config_parser_context *ctx, const char *key) +{ + struct config_parser_key *config_key; + + /* Couldn't get value for the setting, but we're delaying error + handling. Mark all settings parsers containing this key as failed. + See config-parser.h for details. */ + config_key = hash_table_lookup(ctx->all_keys, t_strcut(key, '/')); + if (config_key == NULL) + return -1; + + for (; config_key != NULL; config_key = config_key->next) { + struct config_module_parser *l = + &ctx->cur_section->filter_parser->module_parsers[config_key->info_idx]; + if (l->delayed_error == NULL) + l->delayed_error = ctx->error; + ctx->error = NULL; + } + return 0; +} + static int settings_value_check(struct config_parser_context *ctx, const struct setting_parser_info *info, @@ -796,28 +818,6 @@ int config_apply_line(struct config_parser_context *ctx, value, full_key_r, &root_setting); } -static int -config_apply_error(struct config_parser_context *ctx, const char *key) -{ - struct config_parser_key *config_key; - - /* Couldn't get value for the setting, but we're delaying error - handling. Mark all settings parsers containing this key as failed. - See config-parser.h for details. */ - config_key = hash_table_lookup(ctx->all_keys, t_strcut(key, '/')); - if (config_key == NULL) - return -1; - - for (; config_key != NULL; config_key = config_key->next) { - struct config_module_parser *l = - &ctx->cur_section->filter_parser->module_parsers[config_key->info_idx]; - if (l->delayed_error == NULL) - l->delayed_error = ctx->error; - ctx->error = NULL; - } - return 0; -} - static struct config_module_parser * config_module_parsers_init(pool_t pool) {