]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveconf: Remove prefix from filters and string lists too
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 15 Mar 2024 06:44:01 +0000 (08:44 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:12 +0000 (12:34 +0200)
src/config/doveconf.c

index 12e4deb9ff169c6a2bd6a9759ea4e8050a10199b..a2d8a7e1d73a829f505a8440aeba75430ade83cb 100644 (file)
@@ -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++;