dovecot-2.0: doveconf: Expand "key=$key" variable even without -...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Sep 27 18:46:29 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/1c3d9244f248
changeset: 12188:1c3d9244f248
user: Timo Sirainen <tss at iki.fi>
date: Mon Sep 27 16:46:26 2010 +0100
description:
doveconf: Expand "key=$key" variable even without -x parameter.
Without this expansion it hides what the settings actually contain.
diffstat:
src/config/config-parser.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diffs (33 lines):
diff -r 432208994270 -r 1c3d9244f248 src/config/config-parser.c
--- a/src/config/config-parser.c Mon Sep 27 15:50:43 2010 +0100
+++ b/src/config/config-parser.c Mon Sep 27 16:46:26 2010 +0100
@@ -663,18 +663,20 @@
}
break;
case CONFIG_LINE_TYPE_KEYVARIABLE:
- if (!ctx->expand_values) {
+ /* expand_parent=TRUE for "key = $key stuff".
+ we'll always expand it so that doveconf -n can give
+ usable output */
+ p = strchr(value, ' ');
+ if (p == NULL)
+ var_name = value;
+ else
+ var_name = t_strdup_until(value, p);
+ expand_parent = strcmp(key, var_name) == 0;
+
+ if (!ctx->expand_values && !expand_parent) {
str_append_c(str, '$');
str_append(str, value);
} else {
- p = strchr(value, ' ');
- if (p == NULL)
- var_name = value;
- else
- var_name = t_strdup_until(value, p);
-
- /* expand_parent=TRUE for "key = $key stuff" */
- expand_parent = strcmp(key, var_name) == 0;
var_value = config_get_value(ctx->cur_section, var_name,
expand_parent, &var_type);
if (var_value == NULL) {
More information about the dovecot-cvs
mailing list