]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Hide the trailing NULL in config_parser_context.all_filter_parsers
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 26 Jan 2024 15:00:19 +0000 (17:00 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
Needed by the following changes.

src/config/config-parser.c

index 677b3718559d6574886d2ef9ce11ef7dc5826c03..e5d701d284dd91edef1a4cab8be2277081b56f70 100644 (file)
@@ -1258,8 +1258,7 @@ config_all_parsers_check(struct config_parser_context *ctx,
        }
 
        parsers = array_get(&ctx->all_filter_parsers, &count);
-       i_assert(count > 0 && parsers[count-1] == NULL);
-       count--;
+       i_assert(parsers[count] == NULL);
 
        struct event *event = event_create(NULL);
        event_set_ptr(event, SETTINGS_EVENT_ROOT, set_root);
@@ -1670,6 +1669,7 @@ config_parse_finish(struct config_parser_context *ctx,
        config_drop_overridden_default_settings(ctx);
 
        array_append_zero(&ctx->all_filter_parsers);
+       array_pop_back(&ctx->all_filter_parsers);
        new_config->filter_parsers = array_front(&ctx->all_filter_parsers);
        new_config->module_parsers = ctx->root_module_parsers;