dovecot-2.0: doveconf: Fixed showing plugin {} section.

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 22 23:03:43 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/a94abbccea0f
changeset: 12696:a94abbccea0f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 22 23:03:41 2011 +0200
description:
doveconf: Fixed showing plugin {} section.

diffstat:

 src/config/config-request.c |   2 ++
 src/config/doveconf.c       |  17 ++++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r b5768d835e79 -r a94abbccea0f src/config/config-request.c
--- a/src/config/config-request.c	Tue Mar 22 22:50:26 2011 +0200
+++ b/src/config/config-request.c	Tue Mar 22 23:03:41 2011 +0200
@@ -286,6 +286,8 @@
 				break;
 			}
 			hash_table_insert(ctx->keys, key, key);
+			/* for doveconf -n to see this KEY_LIST */
+			ctx->callback(key, "", CONFIG_KEY_LIST, ctx->context);
 
 			strings = array_get(val, &count);
 			i_assert(count % 2 == 0);
diff -r b5768d835e79 -r a94abbccea0f src/config/doveconf.c
--- a/src/config/doveconf.c	Tue Mar 22 22:50:26 2011 +0200
+++ b/src/config/doveconf.c	Tue Mar 22 23:03:41 2011 +0200
@@ -191,12 +191,19 @@
 	for (i = 0; i < count && strings[i][0] == LIST_KEY_PREFIX[0]; i++) T_BEGIN {
 		p = strchr(strings[i], '=');
 		i_assert(p != NULL);
-		/* string is in format: "list=0 1 2" */
-		for (args = t_strsplit(p + 1, " "); *args != NULL; args++) {
-			str = p_strdup_printf(ctx->pool, "%s/%s/",
-					      t_strcut(strings[i]+1, '='),
-					      *args);
+		if (p[1] == '\0') {
+			/* "strlist=" */
+			str = p_strdup_printf(ctx->pool, "%s/",
+					      t_strcut(strings[i]+1, '='));
 			array_append(&prefixes_arr, &str, 1);
+		} else {
+			/* string is in format: "list=0 1 2" */
+			for (args = t_strsplit(p + 1, " "); *args != NULL; args++) {
+				str = p_strdup_printf(ctx->pool, "%s/%s/",
+						      t_strcut(strings[i]+1, '='),
+						      *args);
+				array_append(&prefixes_arr, &str, 1);
+			}
 		}
 	} T_END;
 	prefixes = array_get(&prefixes_arr, &prefix_count);


More information about the dovecot-cvs mailing list