]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: dict_iterate() - Return NULL as value with DICT_ITERATE_FLAG_NO_VALUE
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 25 Nov 2021 10:56:06 +0000 (12:56 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 17 Jan 2022 11:52:09 +0000 (13:52 +0200)
This makes the behavior more consistent with dict_iterate_values().

src/lib-dict/dict.c

index c4d6541917bf42d1d979695aa3c15d3a52fabe3c..063a28d9908e7196a9df4d3e01ff870f0a70773a 100644 (file)
@@ -402,6 +402,8 @@ bool dict_iterate(struct dict_iterate_context *ctx,
                return FALSE;
        if ((ctx->flags & DICT_ITERATE_FLAG_NO_VALUE) == 0)
                *value_r = values[0];
+       else
+               *value_r = NULL;
        return TRUE;
 }