# HG changeset patch # User Timo Sirainen # Date 1091149439 -10800 # Node ID 9a6d22b5bb7af209ad9bb77e8947200828dcea46 # Parent 00a4d69a1d1cd3ff503438f3425bf36100b05858 mbox corruption fix diff -r 00a4d69a1d1c -r 9a6d22b5bb7a src/lib-storage/index/mbox/mbox-sync-rewrite.c --- a/src/lib-storage/index/mbox/mbox-sync-rewrite.c Wed Jul 28 19:31:54 2004 +0300 +++ b/src/lib-storage/index/mbox/mbox-sync-rewrite.c Fri Jul 30 04:03:59 2004 +0300 @@ -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;