changeset 6507:392a49f0c69a HEAD

Avoid "first_recent_uid 0 -> 1" errors when upgrading from v1.0 index files.
author Timo Sirainen <tss@iki.fi>
date Sun, 30 Sep 2007 15:52:26 +0300
parents c83e3272ae88
children 722bef1a0c4e
files src/lib-index/mail-index-map.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-map.c	Sun Sep 30 15:33:23 2007 +0300
+++ b/src/lib-index/mail-index-map.c	Sun Sep 30 15:52:26 2007 +0300
@@ -441,6 +441,10 @@
 	if (hdr->seen_messages_count > hdr->messages_count ||
 	    hdr->deleted_messages_count > hdr->messages_count)
 		return 0;
+	if (hdr->first_recent_uid == 0 && hdr->minor_version == 0) {
+		/* upgrade silently from v1.0 */
+		map->hdr.first_recent_uid = 1;
+	}
 	if (hdr->first_recent_uid == 0 ||
 	    hdr->first_recent_uid > hdr->next_uid ||
 	    hdr->first_unseen_uid_lowwater > hdr->next_uid ||