changeset 642:5f5fdc45c19d HEAD

Don't rewrite when there's no messages (ie. don't write the one '\n').
author Timo Sirainen <tss@iki.fi>
date Thu, 21 Nov 2002 16:56:07 +0200
parents 83aaf3dc6362
children da34bdd4e0c6
files src/lib-index/mbox/mbox-rewrite.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-rewrite.c	Wed Nov 20 22:06:15 2002 +0200
+++ b/src/lib-index/mbox/mbox-rewrite.c	Thu Nov 21 16:56:07 2002 +0200
@@ -415,7 +415,8 @@
 	if (!index->set_lock(index, MAIL_LOCK_SHARED))
 		return FALSE;
 
-        rewrite = (index->header->flags & INDEX_DIRTY_FLAGS);
+	rewrite = (index->header->flags & INDEX_DIRTY_FLAGS) &&
+		index->header->messages_count > 0;
 
 	if (!index->set_lock(index, MAIL_LOCK_UNLOCK))
 		return FALSE;