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++ != ' ')
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 */
}
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)