[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-rewrite.c, 1.25, 1.26

cras at dovecot.org cras at dovecot.org
Fri Jul 30 04:04:01 EEST 2004


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

Modified Files:
	mbox-sync-rewrite.c 
Log Message:
mbox corruption fix



Index: mbox-sync-rewrite.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- mbox-sync-rewrite.c	3 Jul 2004 18:13:45 -0000	1.25
+++ mbox-sync-rewrite.c	30 Jul 2004 01:03:59 -0000	1.26
@@ -108,11 +108,14 @@
 	/* pos points to end of header now, and start_pos to beginning
 	   of whitespace. */
 
-	if (/*size > 1024 && */skip_space_pos_r != NULL) {
+	if (size > 1024 && skip_space_pos_r != NULL) {
 		/* we're rewriting messages and moving space towards beginning
 		   of file. it's useless to write lots of spaces because we're
 		   overwriting it soon anyway. */
 		*skip_space_pos_r = start_pos;
+
+		/* we'll have to delete the existing space */
+		buffer_delete(ctx->header, start_pos, pos - start_pos);
 	} else {
 		if (skip_space_pos_r != NULL)
 			*skip_space_pos_r = (size_t)-1;



More information about the dovecot-cvs mailing list