dovecot-1.2: dbox: Fixes to handling maildir-converted files.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jan 12 17:32:42 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/e9a28087b9f9
changeset: 8611:e9a28087b9f9
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jan 12 10:32:38 2009 -0500
description:
dbox: Fixes to handling maildir-converted files.

diffstat:

2 files changed, 4 insertions(+), 4 deletions(-)
src/lib-storage/index/dbox/dbox-index.c     |    5 ++---
src/lib-storage/index/dbox/dbox-sync-file.c |    3 ++-

diffs (35 lines):

diff -r 9f98a74e0757 -r e9a28087b9f9 src/lib-storage/index/dbox/dbox-index.c
--- a/src/lib-storage/index/dbox/dbox-index.c	Sat Jan 10 15:37:24 2009 -0500
+++ b/src/lib-storage/index/dbox/dbox-index.c	Mon Jan 12 10:32:38 2009 -0500
@@ -90,7 +90,7 @@ static int dbox_index_parse_maildir(stru
 static int dbox_index_parse_maildir(struct dbox_index *index, const char *line,
 				    struct dbox_index_record *rec)
 {
-	char *p, *p2;
+	char *p;
 	unsigned long uid;
 
 	if (*line++ != ' ')
@@ -100,8 +100,7 @@ static int dbox_index_parse_maildir(stru
 	if (*p++ != ' ' || *p == '\0' || uid == 0 || uid >= (uint32_t)-1)
 		return -1;
 
-	p2 = strstr(p, " :");
-	if (p2 != NULL)
+	if (*p == ':' || strstr(p, " :") != NULL)
 		rec->data = p_strdup(index->record_data_pool, line);
 	else {
 		/* convert to new format */
diff -r 9f98a74e0757 -r e9a28087b9f9 src/lib-storage/index/dbox/dbox-sync-file.c
--- a/src/lib-storage/index/dbox/dbox-sync-file.c	Sat Jan 10 15:37:24 2009 -0500
+++ b/src/lib-storage/index/dbox/dbox-sync-file.c	Mon Jan 12 10:32:38 2009 -0500
@@ -425,7 +425,8 @@ int dbox_sync_file(struct dbox_sync_cont
 	}
 
 	file = dbox_file_init(ctx->mbox, entry->file_id);
-	if (status == DBOX_INDEX_FILE_STATUS_SINGLE_MESSAGE &&
+	if ((status == DBOX_INDEX_FILE_STATUS_SINGLE_MESSAGE ||
+	     status == DBOX_INDEX_FILE_STATUS_MAILDIR) &&
 	    array_is_created(&entry->expunges)) {
 		/* fast path to expunging the whole file */
 		if (dbox_sync_file_unlink(file) < 0)


More information about the dovecot-cvs mailing list