From: Aki Tuomi Date: Fri, 15 Mar 2024 06:44:01 +0000 (+0200) Subject: doveconf: Remove prefix from filters and string lists too X-Git-Tag: 2.4.1~936 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c9eea6963b0530fd5aec77bf7c74474fda305ed;p=thirdparty%2Fdovecot%2Fcore.git doveconf: Remove prefix from filters and string lists too --- diff --git a/src/config/doveconf.c b/src/config/doveconf.c index 12e4deb9ff..a2d8a7e1d7 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -429,10 +429,15 @@ config_dump_human_output(struct config_dump_human_context *ctx, str_append_max(ctx->list_prefix, indent_str, indent*2); p = strchr(key2, '/'); + const char *key_prefix; if (p != NULL) - str_append_data(ctx->list_prefix, key2, p - key2); + key_prefix = t_strndup(key2, p - key2); else - str_append(ctx->list_prefix, key2); + key_prefix = key2; + if (strip_prefix != NULL && + str_begins(key_prefix, strip_prefix, &key_prefix)) + key_prefix++; + str_append(ctx->list_prefix, key_prefix); str_append(ctx->list_prefix, " {\n"); indent++;