From a61e5d5b9c031a6777ae89ac1076448271f6f70d Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Mon, 8 Aug 2005 03:30:59 +0000 Subject: [PATCH] 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. --- imap/command.c | 6 ++++-- imap/imap.c | 4 +++- init.h | 2 +- 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 -- 2.40.0