]> granicus.if.org Git - neomutt/commitdiff
Don't check for the existence of a mailbox we're already in when appending.
authorBrendan Cully <brendan@kublai.com>
Tue, 26 Jul 2005 16:44:20 +0000 (16:44 +0000)
committerBrendan Cully <brendan@kublai.com>
Tue, 26 Jul 2005 16:44:20 +0000 (16:44 +0000)
(closes #1842)

imap/imap.c

index f53633110c7e78b5133792a7d0dce75225c900bc..d6c409a19056bd8f41e1a05a675feec97217022e 100644 (file)
@@ -766,8 +766,15 @@ 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))
     snprintf (buf, sizeof (buf), "STATUS %s (UIDVALIDITY)", mbox);
   else if (mutt_bit_isset(idata->capabilities,STATUS))
@@ -778,10 +785,10 @@ int imap_open_mailbox_append (CONTEXT *ctx)
   {
     /* STATUS not supported */
     mutt_message _("Unable to append to IMAP mailboxes at this server");
-
+    
     goto fail;
   }
-
+  
   r = imap_exec (idata, buf, IMAP_CMD_FAIL_OK);
   if (r == -2)
   {