summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2005-08-08 03:30:59 +0000
committerBrendan Cully <brendan@kublai.com>2005-08-08 03:30:59 +0000
commita61e5d5b9c031a6777ae89ac1076448271f6f70d (patch)
tree2a0c5a86969da81dc4190b416668f3e9228441b9
parent1a79e5e7c724c17ec627aa64a710bbd8147e1a1e (diff)
Fix bug just introduced in lsub parsing that could cause mutt to loop indefinitely.
Don't recheck subscriptions at every mailbox change, just the initial connection.
-rw-r--r--imap/command.c6
-rw-r--r--imap/imap.c4
-rw-r--r--init.h2
3 files changed, 8 insertions, 4 deletions
diff --git a/imap/command.c b/imap/command.c
index 20f76cab..71ed859e 100644
--- a/imap/command.c
+++ b/imap/command.c
@@ -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 */
diff --git a/imap/imap.c b/imap/imap.c
index d0e849de..968fe723 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -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 0ec78c74..1f46d390 100644
--- 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