]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Move delay_errors check into config_apply_error()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 3 Feb 2024 21:58:26 +0000 (23:58 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
This simplifies the next commit.

src/config/config-parser.c

index 0b3b4463db5297f78d3e8d44241452309f04615f..6b3ceacea8ea2f496ac1bab8f215279b6ad0d166 100644 (file)
@@ -309,6 +309,9 @@ config_apply_error(struct config_parser_context *ctx, const char *key)
 {
        struct config_parser_key *config_key;
 
+       if (!ctx->delay_errors)
+               return -1;
+
        /* 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. */
@@ -1934,8 +1937,7 @@ void config_parser_apply_line(struct config_parser_context *ctx,
        case CONFIG_LINE_TYPE_KEYFILE:
        case CONFIG_LINE_TYPE_KEYVARIABLE:
                if (config_write_value(ctx, line) < 0) {
-                       if (!ctx->delay_errors ||
-                           config_apply_error(ctx, line->key) < 0)
+                       if (config_apply_error(ctx, line->key) < 0)
                                break;
                } else {
                        /* Either a global key or list/key */