From 3a5efec57d4b72ef5fb251cc91dc8cd460f0bcd5 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 18 Jan 2000 22:23:53 +0000 Subject: [PATCH] Fix use of confirmcreate with IMAP. A patch for this was suggested by Brian R. Gaeke. --- imap/imap.c | 18 ++++++------------ imap/message.c | 16 +++++++--------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/imap/imap.c b/imap/imap.c index 6830fbee..ead41b15 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -801,18 +801,12 @@ int imap_open_mailbox_append (CONTEXT *ctx) if (r == -2) { /* command failed cause folder doesn't exist */ - if (option (OPTCONFIRMCREATE)) - { - snprintf (buf, sizeof (buf), _("Create %s?"), mailbox); - if (mutt_yesorno (buf, 1) < 1) - { - return (-1); - } - if (imap_create_mailbox (ctx, mailbox) < 0) - { - return (-1); - } - } + snprintf (buf, sizeof (buf), _("Create %s?"), mailbox); + if (option (OPTCONFIRMCREATE) && mutt_yesorno (buf, 1) < 1) + return (-1); + + if (imap_create_mailbox (ctx, mailbox) < 0) + return (-1); } else if (r == -1) { diff --git a/imap/message.c b/imap/message.c index f959187b..d5c894c1 100644 --- a/imap/message.c +++ b/imap/message.c @@ -569,17 +569,15 @@ int imap_copy_messages (CONTEXT* ctx, HEADER* h, char* dest, int delete) return -1; } dprint (2, (debugfile, "imap_copy_messages: server suggests TRYCREATE\n")); - if (option (OPTCONFIRMCREATE)) + snprintf (buf, sizeof (buf), _("Create %s?"), mbox); + if (option (OPTCONFIRMCREATE) && mutt_yesorno (buf, 1) < 1) { - snprintf (buf, sizeof (buf), _("Create %s?"), mbox); - if (mutt_yesorno (buf, 1) < 1) - { - mutt_clear_error (); - return -1; - } - if (imap_create_mailbox (ctx, mbox) < 0) - return -1; + mutt_clear_error (); + return -1; } + if (imap_create_mailbox (ctx, mbox) < 0) + return -1; + /* try again */ rc = imap_exec (buf, sizeof (buf), CTX_DATA, cmd, 0); } -- 2.40.0