changeset 8611:e9a28087b9f9 HEAD

dbox: Fixes to handling maildir-converted files.
author Timo Sirainen <tss@iki.fi>
date Mon, 12 Jan 2009 10:32:38 -0500
parents 9f98a74e0757
children 3ee12ca9e2c4
files src/lib-storage/index/dbox/dbox-index.c src/lib-storage/index/dbox/dbox-sync-file.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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(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 @@
 	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 */
--- 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 @@
 	}
 
 	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)