dovecot-2.0: config: Export also empty setting values also, if e...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jun 24 04:18:38 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/498965c87314
changeset: 9524:498965c87314
user: Timo Sirainen <tss at iki.fi>
date: Tue Jun 23 21:18:33 2009 -0400
description:
config: Export also empty setting values also, if empty isn't the default.
diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
src/config/config-request.c | 12 +++++++++---
diffs (51 lines):
diff -r 3f9dcaf102d1 -r 498965c87314 src/config/config-request.c
--- a/src/config/config-request.c Tue Jun 23 21:17:32 2009 -0400
+++ b/src/config/config-request.c Tue Jun 23 21:18:33 2009 -0400
@@ -80,12 +80,14 @@ static void settings_export(struct setti
unsigned int i, count, prefix_len;
const char *str;
char *key;
+ bool dump;
for (def = info->defines; def->key != NULL; def++) {
value = CONST_PTR_OFFSET(set, def->offset);
default_value = info->defaults == NULL ? NULL :
CONST_PTR_OFFSET(info->defaults, def->offset);
+ dump = FALSE;
count = 0;
str_truncate(ctx->value, 0);
switch (def->type) {
@@ -115,8 +117,10 @@ static void settings_export(struct setti
sval = *val == NULL ? NULL : (*val + 1);
if ((ctx->export_defaults ||
- null_strcmp(sval, dval) != 0) && sval != NULL)
+ null_strcmp(sval, dval) != 0) && sval != NULL) {
str_append(ctx->value, sval);
+ dump = TRUE;
+ }
break;
}
case SET_STR: {
@@ -125,8 +129,10 @@ static void settings_export(struct setti
const char *dval = _dval == NULL ? NULL : *_dval;
if ((ctx->export_defaults ||
- null_strcmp(*val, dval) != 0) && *val != NULL)
+ null_strcmp(*val, dval) != 0) && *val != NULL) {
str_append(ctx->value, *val);
+ dump = TRUE;
+ }
break;
}
case SET_ENUM: {
@@ -188,7 +194,7 @@ static void settings_export(struct setti
break;
}
}
- if (str_len(ctx->value) > 0) {
+ if (str_len(ctx->value) > 0 || dump) {
key = p_strconcat(ctx->pool, str_c(ctx->prefix),
def->key, NULL);
if (hash_table_lookup(ctx->keys, key) == NULL) {
More information about the dovecot-cvs
mailing list