(mailbox_flush): Do not re-save all messages if the mailbox was opened in append mode.
Showing
1 changed file
with
5 additions
and
1 deletions
... | @@ -209,7 +209,11 @@ mailbox_flush (mailbox_t mbox, int expunge) | ... | @@ -209,7 +209,11 @@ mailbox_flush (mailbox_t mbox, int expunge) |
209 | if (!(mbox->flags & (MU_STREAM_RDWR|MU_STREAM_WRITE|MU_STREAM_APPEND))) | 209 | if (!(mbox->flags & (MU_STREAM_RDWR|MU_STREAM_WRITE|MU_STREAM_APPEND))) |
210 | return EACCES; | 210 | return EACCES; |
211 | mailbox_messages_count (mbox, &total); | 211 | mailbox_messages_count (mbox, &total); |
212 | for (i = 1; i <= total; i++) | 212 | if (mbox->flags & MU_STREAM_APPEND) |
213 | i = total; | ||
214 | else | ||
215 | i = 1; | ||
216 | for ( ; i <= total; i++) | ||
213 | { | 217 | { |
214 | message_t msg = NULL; | 218 | message_t msg = NULL; |
215 | attribute_t attr = NULL; | 219 | attribute_t attr = NULL; | ... | ... |
-
Please register or sign in to post a comment