X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fimap.c;h=099be6261173c3a290835118fc2a153d2ee4ad0d;hb=3b919698dd232fc7008c4e14f9dc7e74e6c5d298;hp=40489b439ecacf75ecc515551c51ecaafa77f5c3;hpb=2c522cac0278dd774896f25048da2c5cc1d9cf99;p=apps%2Fmadmutt.git diff --git a/imap/imap.c b/imap/imap.c index 40489b4..099be62 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -716,6 +716,12 @@ int imap_open_mailbox_append (CONTEXT * ctx) imap_fix_path (idata, mx.mbox, mailbox, sizeof (mailbox)); + /* We may be appending to the same folder we've selected. */ + if (!ascii_strcmp(idata->mailbox, mx.mbox)) { + FREE (&mx.mbox); + return 0; + } + imap_munge_mbox_name (mbox, sizeof (mbox), mailbox); if (mutt_bit_isset (idata->capabilities, IMAP4REV1)) @@ -1073,7 +1079,7 @@ void imap_close_mailbox (CONTEXT * ctx) return; if (ctx == idata->ctx) { - if (idata->state = IMAP_SELECTED) { + if (idata->state == IMAP_SELECTED) { /* mx_close_mailbox won't sync if there are no deleted messages * and the mailbox is unchanged, so we may have to close here */ if (idata->status != IMAP_FATAL && !ctx->deleted &&