changeset 2405:4f827b29c9b8 HEAD

Fix rewriting pseudo header when it needs to grow.
author Timo Sirainen <tss@iki.fi>
date Sat, 31 Jul 2004 03:48:09 +0300
parents 8ef002a26f1c
children e08fd0ea6907
files src/lib-storage/index/mbox/mbox-sync.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync.c	Sat Jul 31 03:33:53 2004 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Sat Jul 31 03:48:09 2004 +0300
@@ -491,14 +491,15 @@
 	idx = 0;
 	idx_seq = sync_ctx->need_space_idx_seq;
 	if (idx_seq == 0) {
+		/* pseudo-header, skip it */
 		idx++; idx_seq++;
 	}
 
-	for (; idx < size; idx++, idx_seq++, mails++) {
-		if (mails->uid == 0)
+	for (; idx < size; idx++, idx_seq++) {
+		if (mails[idx].uid == 0)
 			continue;
 
-		offset = mails->from_offset;
+		offset = mails[idx].from_offset;
 		mail_index_update_extra_rec(sync_ctx->t, idx_seq, extra_idx,
 					    &offset);
 	}
@@ -567,7 +568,8 @@
 	if (ret == 0 && sync_ctx->need_space_seq == 0) {
 		/* first mail with no space to write it */
 		sync_ctx->need_space_seq = sync_ctx->seq;
-		sync_ctx->need_space_idx_seq = sync_ctx->idx_seq;
+		sync_ctx->need_space_idx_seq =
+			mail_ctx->pseudo ? 0 : sync_ctx->idx_seq;
 		sync_ctx->space_diff = 0;
 
 		if (sync_ctx->expunged_space > 0) {