don't bother renaming the message file if we are about to unlink() it

This commit is contained in:
Michael Elkins 2002-01-17 19:33:25 +00:00
parent dd22bd3f22
commit d00a65bebd

7
sync.c
View File

@ -200,6 +200,11 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
mbox->deleted++;
cur->flags |= (tmp->flags & ~(D_RECENT | D_DRAFT));
/* don't bother renaming the file if we are just going to
* remove it later.
*/
if ((cur->flags & D_DELETED) == 0 || (flags & SYNC_EXPUNGE) == 0)
{
/* generate old path */
snprintf (path, sizeof (path), "%s/%s/%s",
mbox->path, cur->new ? "new" : "cur", cur->file);
@ -230,6 +235,8 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
p = strrchr (newpath, '/');
free (cur->file);
cur->file = strdup (p + 1);
cur->new = 0; /* not any more */
}
}
}
}