dovecot-2.0: config: Allow key=$var to contain other text after ...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Mar 1 22:02:03 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/4b744015a8ae
changeset: 10820:4b744015a8ae
user: Timo Sirainen <tss at iki.fi>
date: Mon Mar 01 22:01:57 2010 +0200
description:
config: Allow key=$var to contain other text after the $var.
diffstat:
src/config/config-parser.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (42 lines):
diff -r 6a8ee83cbc8c -r 4b744015a8ae src/config/config-parser.c
--- a/src/config/config-parser.c Mon Mar 01 00:34:43 2010 +0200
+++ b/src/config/config-parser.c Mon Mar 01 22:01:57 2010 +0200
@@ -637,7 +637,7 @@
const char *key, const char *value,
const char **errormsg_r)
{
- const void *var_value;
+ const void *var_name, *var_value, *p;
enum setting_type var_type;
bool dump;
@@ -661,18 +661,26 @@
str_append_c(str, '$');
str_append(str, value);
} else {
- var_value = config_get_value(ctx, value, &var_type);
+ p = strchr(value, ' ');
+ if (p == NULL)
+ var_name = value;
+ else
+ var_name = t_strdup_until(value, p);
+
+ var_value = config_get_value(ctx, var_name, &var_type);
if (var_value == NULL) {
*errormsg_r = t_strconcat("Unknown variable: $",
- value, NULL);
+ var_name, NULL);
return -1;
}
if (!config_export_type(str, var_value, NULL,
var_type, TRUE, &dump)) {
*errormsg_r = t_strconcat("Invalid variable: $",
- value, NULL);
+ var_name, NULL);
return -1;
}
+ if (p != NULL)
+ str_append(str, p);
}
break;
default:
More information about the dovecot-cvs
mailing list