]> granicus.if.org Git - neomutt/commitdiff
The attached small patch adjusts mutt_pretty_mailbox to handle
authorBrendan Cully <brendan@kublai.com>
Mon, 28 Aug 2000 09:39:35 +0000 (09:39 +0000)
committerBrendan Cully <brendan@kublai.com>
Mon, 28 Aug 2000 09:39:35 +0000 (09:39 +0000)
URLs.

imap/auth_sasl.c
imap/command.c
imap/imap_private.h
muttlib.c

index b628d8fc3989f134fd351d43cc41796cc1d85d09..d1c5c904dcb71f1d083777587b91489cc063f2f5 100644 (file)
@@ -101,7 +101,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata)
       irc = imap_cmd_step (idata);
     while (irc == IMAP_CMD_CONTINUE);
 
-    if (irc == IMAP_CMD_FAIL)
+    if (irc == IMAP_CMD_FAIL || irc == IMAP_CMD_NO)
       goto bail;
 
     if (irc == IMAP_CMD_RESPOND)
index babde98ee801072466822a1b72de4251d682c69b..bc8df99489b2237772c68266bea069dbef99340c 100644 (file)
@@ -146,7 +146,7 @@ int imap_cmd_step (IMAP_DATA* idata)
   if (!mutt_strncmp (idata->buf, idata->seq, SEQLEN))
   {
     cmd_finish (idata);
-    return IMAP_CMD_DONE;
+    return imap_code (idata->buf) ? IMAP_CMD_DONE : IMAP_CMD_NO;
   }
 
   return IMAP_CMD_CONTINUE;
index 9611890e4d1f5ceeb4944a1a385b99b0a0433397..0c980925dc7645182ff3a3d4caaa5f73cd221169 100644 (file)
@@ -35,6 +35,7 @@
 /* IMAP command responses */
 #define IMAP_CMD_DONE     (0)
 #define IMAP_CMD_FAIL     (-1)
+#define IMAP_CMD_NO       (-2)
 #define IMAP_CMD_CONTINUE (1)
 #define IMAP_CMD_RESPOND  (2)
 
index 0b930a64e55fd2693276803d41a553c36546a66b..365e9327e423c67798a96c538589a4f7f236e9bb 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -22,6 +22,7 @@
 #include "mime.h"
 #include "mailbox.h"
 #include "mx.h"
+#include "url.h"
 
 #ifdef HAVE_PGP
 #include "pgp.h"
@@ -663,6 +664,18 @@ void mutt_pretty_mailbox (char *s)
   char *p = s, *q = s;
   size_t len;
 
+  /* if s is an url, only collapse path component */
+  if (url_check_scheme (s) != U_UNKNOWN)
+  {
+    p = strchr(s, ':')+1;
+    if (!strncmp (p, "//", 2))
+      q = strchr (p+2, '/');
+    if (!q)
+      q = p;
+    else
+      p = q;
+  }
+  
   /* first attempt to collapse the pathname */
   while (*p)
   {