]> granicus.if.org Git - mutt/commitdiff
Currently, Mutt won't use a default folder if just the IMAP server is
authorThomas Roessler <roessler@does-not-exist.org>
Fri, 13 Nov 1998 18:31:06 +0000 (18:31 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Fri, 13 Nov 1998 18:31:06 +0000 (18:31 +0000)
specified.  In fact, if the folder isn't specified, it will core-dump.

The attached patch will use INBOX as the IMAP folder name if none is
specified, eliminating the core-dump.

(From: Aaron Schrab <aaron+mutt@schrab.com>)

imap.c

diff --git a/imap.c b/imap.c
index f1a17e54096567bd2798b2dc9633d312f768848a..1057316055cf0779a37368882be72a7fc8f389c7 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -969,7 +969,7 @@ int imap_open_mailbox (CONTEXT *ctx)
   ctx->data = safe_malloc (sizeof (IMAP_DATA));
   memset (ctx->data, 0, sizeof (IMAP_DATA));
 
-  CTX_DATA->mailbox = safe_strdup (pc);
+  CTX_DATA->mailbox = safe_strdup (*pc?pc:"INBOX");
 
   conn = mutt_socket_select_connection (host, IMAP_PORT, M_NEW_SOCKET);
   CTX_DATA->conn = conn;