dovecot-1.1: dbox: Fixes to handling maildir-converted files.
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jan 12 17:25:08 EET 2009
details: http://hg.dovecot.org/dovecot-1.1/rev/3ca9bff0e048
changeset: 8083:3ca9bff0e048
user: Timo Sirainen <tss at iki.fi>
date: Mon Jan 12 10:24:59 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 e922f0b6436e -r 3ca9bff0e048 src/lib-storage/index/dbox/dbox-index.c
--- a/src/lib-storage/index/dbox/dbox-index.c Fri Jan 09 14:03:05 2009 -0500
+++ b/src/lib-storage/index/dbox/dbox-index.c Mon Jan 12 10:24:59 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 e922f0b6436e -r 3ca9bff0e048 src/lib-storage/index/dbox/dbox-sync-file.c
--- a/src/lib-storage/index/dbox/dbox-sync-file.c Fri Jan 09 14:03:05 2009 -0500
+++ b/src/lib-storage/index/dbox/dbox-sync-file.c Mon Jan 12 10:24:59 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