summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-03-15 14:43:25 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-03-15 14:43:25 +0000
commitac26e0ea68371b4e7b13e3a50e135f94cdd6fd11 (patch)
tree450a44e5d2d50688c24cd49e65ce2cec5ede763f
parentd4907075b8c420919c5a0d06bc7eea49e8a1234a (diff)
downloadmailutils-ac26e0ea68371b4e7b13e3a50e135f94cdd6fd11.tar.gz
mailutils-ac26e0ea68371b4e7b13e3a50e135f94cdd6fd11.tar.bz2
(mailbox_flush): Do not re-save all messages if the mailbox was opened in append mode.
-rw-r--r--mailbox/mailbox.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mailbox/mailbox.c b/mailbox/mailbox.c
index 0a253fa35..ee8eec96e 100644
--- a/mailbox/mailbox.c
+++ b/mailbox/mailbox.c
@@ -209,7 +209,11 @@ mailbox_flush (mailbox_t mbox, int expunge)
if (!(mbox->flags & (MU_STREAM_RDWR|MU_STREAM_WRITE|MU_STREAM_APPEND)))
return EACCES;
mailbox_messages_count (mbox, &total);
- for (i = 1; i <= total; i++)
+ if (mbox->flags & MU_STREAM_APPEND)
+ i = total;
+ else
+ i = 1;
+ for ( ; i <= total; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;

Return to:

Send suggestions and report system problems to the System administrator.