[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-parse.c, 1.49, 1.49.2.1

tss-movial at dovecot.org tss-movial at dovecot.org
Fri May 12 16:26:34 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv21630/src/lib-storage/index/mbox

Modified Files:
      Tag: branch_1_0
	mbox-sync-parse.c 
Log Message:
Don't cause whitespace offsets to break if some headers before it were removed (eg. extra X-IMAPbase headers)



Index: mbox-sync-parse.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-parse.c,v
retrieving revision 1.49
retrieving revision 1.49.2.1
diff -u -d -r1.49 -r1.49.2.1
--- mbox-sync-parse.c	14 Jan 2006 18:47:52 -0000	1.49
+++ mbox-sync-parse.c	12 May 2006 13:26:32 -0000	1.49.2.1
@@ -62,7 +62,7 @@
 
 	if ((ssize_t)space > ctx->mail.space) {
 		i_assert(space != 0);
-		ctx->mail.offset = hdr->full_value_offset + i;
+		ctx->mail.offset = ctx->hdr_offset + str_len(ctx->header) + i;
 		ctx->mail.space = space;
 	}
 }
@@ -206,9 +206,11 @@
 		uid_last = uid_last * 10 + (hdr->full_value[i] - '0');
 	}
 
-	if (j != 10) {
+	if (j != 10 ||
+	    hdr->full_value_offset != ctx->hdr_offset + str_len(ctx->header)) {
 		/* uid-last field must be exactly 10 characters to make
-		   rewriting it easier. */
+		   rewriting it easier. also don't try to do this if some
+		   headers have been removed */
 		ctx->imapbase_rewrite = TRUE;
 		ctx->need_rewrite = TRUE;
 	} else {



More information about the dovecot-cvs mailing list