Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9539:0454fde95cbf HEAD
lib-index: Changed strmap's crc32 field to be backwards compatible.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 06 Feb 2010 00:38:04 +0200 |
parents | c24a31b423ed |
children | ef3b30b24c7c |
files | src/lib-index/mail-index-strmap.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-strmap.c Sat Feb 06 01:16:26 2010 +0200 +++ b/src/lib-index/mail-index-strmap.c Sat Feb 06 00:38:04 2010 +0200 @@ -741,7 +741,10 @@ static inline uint32_t crc32_str_nonzero(const char *str) { - uint32_t value = crc32_str(str); + /* we'll flip the bits because of a bug in our old crc32 code. + this keeps the index format backwards compatible with the new fixed + crc32 code. */ + uint32_t value = crc32_str(str) ^ 0xffffffffU; return value == 0 ? 1 : value; }