changeset 2740:20faabfb838b HEAD

fix
author Timo Sirainen <tss@iki.fi>
date Wed, 13 Oct 2004 23:40:25 +0300
parents ebcb45283c70
children 95fd6024e1e2
files src/lib-storage/index/mbox/mbox-sync.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync.c	Wed Oct 13 23:21:21 2004 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Wed Oct 13 23:40:25 2004 +0300
@@ -985,6 +985,12 @@
 	if (sync_ctx->expunged_space > 0) {
 		/* copy trailer, then truncate the file */
 		file_size = i_stream_get_size(sync_ctx->file_input);
+		if (file_size == (uoff_t)sync_ctx->expunged_space) {
+			/* everything deleted, the trailer_size still contains
+			   the \n trailer though */
+			trailer_size = 0;
+		}
+
 		i_assert(file_size >= sync_ctx->expunged_space + trailer_size);
 		offset = file_size - sync_ctx->expunged_space - trailer_size;