]> 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)
committerGitLab <gitlab@git.dovecot.net>
Fri, 18 Nov 2016 11:42:01 +0000 (13:42 +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 e20fa8c4e46dbdc47d6425fcd9d65ff7e3b61692..54e34b016e0ce98bf9af5c7b09087b58910d930f 100644 (file)
@@ -785,8 +785,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);