Skip to content

Commit

Permalink
dbox: Fixed pop3.order caching for mails without no specified order.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Mar 16, 2016
1 parent 9354228 commit c99596a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib-storage/index/dbox-common/dbox-mail.c
Expand Up @@ -182,7 +182,15 @@ dbox_get_cached_metadata(struct dbox_mail *mail, enum dbox_metadata_key key,
i_assert(str_len(str) == sizeof(order));
memcpy(&order, str_data(str), sizeof(order));
str_truncate(str, 0);
str_printfa(str, "%u", order);
if (order != 0)
str_printfa(str, "%u", order);
else {
/* order=0 means it doesn't exist. we don't
want to return "0" though, because then the
mails get ordered to beginning, while
nonexistent are supposed to be ordered at
the end. */
}
}
*value_r = str_c(str);
return 0;
Expand Down

0 comments on commit c99596a

Please sign in to comment.