From f256e3142783a7cecbe780ed9056466403185772 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 3 Feb 2024 23:58:26 +0200 Subject: [PATCH] config: Move delay_errors check into config_apply_error() This simplifies the next commit. --- src/config/config-parser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 0b3b4463db..6b3ceacea8 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -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 */ -- 2.47.3