X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fbrowse.c;h=fd9c4730e467e205cfaa4f4ebeae1604fe316d81;hp=30eb5e6682dc2c21b6aac15f7ee3d61a398f3384;hb=adbac5bafc8f1ebe348b38342ace473f128d762a;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d diff --git a/imap/browse.c b/imap/browse.c index 30eb5e6..fd9c473 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -23,6 +23,8 @@ #include "lib/debug.h" #include "mutt.h" +#include "ascii.h" +#include "enter.h" #include "imap_private.h" /* -- forward declarations -- */ @@ -60,6 +62,7 @@ int imap_browse (char *path, struct browser_state *state) short showparents = 0; int noselect; int noinferiors; + int save_lsub; IMAP_MBOX mx; if (imap_parse_path (path, &mx)) { @@ -67,6 +70,8 @@ int imap_browse (char *path, struct browser_state *state) return -1; } + save_lsub = option (OPTIMAPCHECKSUBSCRIBED); + unset_option (OPTIMAPCHECKSUBSCRIBED); strfcpy (list_cmd, option (OPTIMAPLSUB) ? "LSUB" : "LIST", sizeof (list_cmd)); @@ -223,11 +228,16 @@ int imap_browse (char *path, struct browser_state *state) } } - FREE (&mx.mbox); + if (save_lsub) + set_option (OPTIMAPCHECKSUBSCRIBED); + + mem_free (&mx.mbox); return 0; fail: - FREE (&mx.mbox); + if (save_lsub) + set_option (OPTIMAPCHECKSUBSCRIBED); + mem_free (&mx.mbox); return -1; } @@ -274,11 +284,11 @@ int imap_mailbox_create (const char *folder) mutt_sleep (0); - FREE (&mx.mbox); + mem_free (&mx.mbox); return 0; fail: - FREE (&mx.mbox); + mem_free (&mx.mbox); return -1; } @@ -319,11 +329,11 @@ int imap_mailbox_rename (const char *mailbox) mutt_message (_("Mailbox renamed.")); mutt_sleep (0); - FREE (&mx.mbox); + mem_free (&mx.mbox); return 0; fail: - FREE (&mx.mbox); + mem_free (&mx.mbox); return -1; } @@ -346,7 +356,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd, do { if (imap_parse_list_response (idata, &name, &noselect, &noinferiors, &idata->delim) != 0) { - FREE (&mx.mbox); + mem_free (&mx.mbox); return -1; } @@ -362,7 +372,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd, } while ((ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0)); - FREE (&mx.mbox); + mem_free (&mx.mbox); return 0; } @@ -382,7 +392,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, imap_unmunge_mbox_name (folder); if (state->entrylen + 1 == state->entrymax) { - safe_realloc (&state->entry, + mem_realloc (&state->entry, sizeof (struct folder_file) * (state->entrymax += 256)); memset (state->entry + state->entrylen, 0, (sizeof (struct folder_file) * @@ -402,7 +412,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, * than at scan, since it's so expensive to scan. But that's big changes * to browser.c */ if (!((regexec (Mask.rx, relpath, 0, NULL, 0) == 0) ^ Mask.not)) { - FREE (&mx.mbox); + mem_free (&mx.mbox); return; } @@ -426,7 +436,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, (state->entry)[state->entrylen].inferiors = !noinferiors; (state->entrylen)++; - FREE (&mx.mbox); + mem_free (&mx.mbox); } static int compare_names (struct folder_file *a, struct folder_file *b)