]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Add CONFIG_KEY_ESCAPE_CHARS macro
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 6 Mar 2025 12:19:45 +0000 (14:19 +0200)
committermarkus.valentin <markus.valentin@open-xchange.com>
Mon, 10 Mar 2025 08:33:25 +0000 (08:33 +0000)
src/config/doveconf.c

index 41b646f87f84a2010570b4d0be038d13800b7a4b..6aec1768bfbf5e1a9ac6849efaccab6d13b179bd 100644 (file)
@@ -42,6 +42,9 @@ struct config_dump_human_context {
        bool list_prefix_sent:1;
 };
 
+/* Characters in setting keys which require escaping */
+#define CONFIG_KEY_ESCAPE_CHARS " \"\\#="
+
 #define LIST_KEY_PREFIX "\001"
 #define BOOLLIST_ELEM_KEY_PREFIX "\002"
 
@@ -582,7 +585,7 @@ config_dump_human_output(struct config_dump_human_context *ctx,
                i_assert(value != NULL);
                if (!hide_key || bool_list_elem || str_list_elem) {
                        key = t_strdup_until(key, value);
-                       if (strpbrk(key, " \"\\#=") == NULL)
+                       if (strpbrk(key, CONFIG_KEY_ESCAPE_CHARS) == NULL)
                                o_stream_nsend_str(output, key);
                        else {
                                o_stream_nsend(output, "\"", 1);