changeset 6678:6601ee607b6f HEAD

Don't drop all fields if day_stamp is still 0 in index header.
author Timo Sirainen <tss@iki.fi>
date Sat, 03 Nov 2007 22:32:21 +0200
parents 90bcf480312d
children 90196328bcce
files src/lib-index/mail-cache-compress.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-compress.c	Sat Nov 03 21:56:05 2007 +0200
+++ b/src/lib-index/mail-cache-compress.c	Sat Nov 03 22:32:21 2007 +0200
@@ -202,7 +202,8 @@
 
 	/* @UNSAFE: drop unused fields and create a field mapping for
 	   used fields */
-	max_drop_time = idx_hdr->day_stamp - MAIL_CACHE_FIELD_DROP_SECS;
+	max_drop_time = idx_hdr->day_stamp == 0 ? 0 :
+		idx_hdr->day_stamp - MAIL_CACHE_FIELD_DROP_SECS;
 	orig_fields_count = cache->fields_count;
 	for (i = used_fields_count = 0; i < orig_fields_count; i++) {
 		if (cache->fields[i].last_used < max_drop_time)