]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: fix index_mail_get_headers return value
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Thu, 17 Nov 2016 20:59:02 +0000 (15:59 -0500)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 11:55:49 +0000 (13:55 +0200)
And make it more obvious that we're not setting the actual return value in
index_mail_get_first_header.

src/lib-storage/index/index-mail-headers.c

index e838f927b3e4a91a09d48c052b39323337fec614..8dcaf9cb7637a5afd21fe251fb64acaa6c990b9d 100644 (file)
@@ -788,8 +788,10 @@ int index_mail_get_headers(struct mail *_mail, const char *field,
        for (;; retry = FALSE) {
                if (index_mail_get_raw_headers(mail, field, value_r) < 0)
                        return -1;
-               if (!decode_to_utf8 || **value_r == NULL)
+               if (**value_r == NULL)
                        return 0;
+               if (!decode_to_utf8)
+                       return 1;
 
                T_BEGIN {
                        ret = index_mail_headers_decode(mail, value_r, UINT_MAX);