]> granicus.if.org Git - neomutt/commitdiff
Fix bug just introduced in lsub parsing that could cause mutt to loop indefinitely.
authorBrendan Cully <brendan@kublai.com>
Mon, 8 Aug 2005 03:30:59 +0000 (03:30 +0000)
committerBrendan Cully <brendan@kublai.com>
Mon, 8 Aug 2005 03:30:59 +0000 (03:30 +0000)
Don't recheck subscriptions at every mailbox change, just the initial connection.

imap/command.c
imap/imap.c
init.h

index 20f76cabd7ed239fdd2d99fae6f74952feebd25a..71ed859ea8cfad88deb4255758bc4bc3e52cf74e 100644 (file)
@@ -546,8 +546,10 @@ static void cmd_parse_lsub (IMAP_DATA* idata, char* s)
   {
     if (!ascii_strncasecmp (s, "\\NoSelect", 9))
       return;
-    if (*s != ')')
-      s = imap_next_word (s);
+    while (s < ep && *s != ' ' && *s != ')')
+      s++;
+    if (*s == ' ')
+      s++;
   } while (s != ep);
 
   s = imap_next_word (s); /* delim */
index d0e849debc9b0ff7aa0ba651d04df97fe4b2d54a..968fe723f68076cefbf24c04b54bfdf989633668 100644 (file)
@@ -351,6 +351,7 @@ IMAP_DATA* imap_conn_find (const ACCOUNT* account, int flags)
   CONNECTION* conn;
   IMAP_DATA* idata;
   ACCOUNT* creds;
+  int new = 0;
 
   if (!(conn = mutt_conn_find (NULL, account)))
     return NULL;
@@ -392,6 +393,7 @@ IMAP_DATA* imap_conn_find (const ACCOUNT* account, int flags)
 
     conn->data = idata;
     idata->conn = conn;
+    new = 1;
   }
 
   if (idata->state == IMAP_DISCONNECTED)
@@ -410,7 +412,7 @@ IMAP_DATA* imap_conn_find (const ACCOUNT* account, int flags)
     
     FREE (&idata->capstr);
   }
-  if (idata->state == IMAP_AUTHENTICATED)
+  if (new && idata->state == IMAP_AUTHENTICATED)
   {
     imap_get_delim (idata);
     if (option (OPTIMAPCHECKSUBSCRIBED))
diff --git a/init.h b/init.h
index 0ec78c7417b0ebb857fcfb9ac301e1a4786be1f5..1f46d390c4493c7ed2644a6f5d55129013ea5abc 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1057,7 +1057,7 @@ struct option_t MuttVars[] = {
   ** \fBDON'T CHANGE THIS SETTING UNLESS YOU ARE REALLY SURE WHAT YOU ARE
   ** DOING!\fP
   */
-#if USE_HCACHE
+#ifdef USE_HCACHE
   { "header_cache", DT_PATH, R_NONE, UL &HeaderCache, 0 },
   /*
   ** .pp