From: Mehdi Abaakouk Date: Wed, 14 Nov 2018 08:36:44 +0000 (+0100) Subject: imap: remove ImapMbox from browse_add_list_result() X-Git-Tag: 2019-10-25~529^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fb4a49f5ff3aa8c301e06b886734b3d680b2785;p=neomutt imap: remove ImapMbox from browse_add_list_result() --- diff --git a/imap/browse.c b/imap/browse.c index f1bd0d0bf..2d780ca97 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -35,6 +35,7 @@ #include #include "imap/imap_private.h" #include "mutt/mutt.h" +#include "email/url.h" #include "conn/conn.h" #include "mutt.h" #include "account.h" @@ -143,14 +144,11 @@ static int browse_add_list_result(struct ImapAccountData *adata, const char *cmd struct BrowserState *state, bool isparent) { struct ImapList list; - struct ImapMbox mx; int rc; - - if (imap_parse_path(state->folder, &mx)) - { - mutt_debug(2, "current folder %s makes no sense\n", state->folder); - return -1; - } + struct Url url; + char tmp[PATH_MAX]; + mutt_str_strfcpy(tmp, state->folder, sizeof(tmp)); + url_parse(&url, tmp); imap_cmd_start(adata, cmd); adata->cmdtype = IMAP_CT_LIST; @@ -166,13 +164,12 @@ static int browse_add_list_result(struct ImapAccountData *adata, const char *cmd if (isparent) list.noselect = true; /* prune current folder from output */ - if (isparent || !mutt_str_startswith(mx.mbox, list.name, CASE_MATCH)) + if (isparent || !mutt_str_startswith(list.name, url.path, CASE_MATCH)) add_folder(list.delim, list.name, list.noselect, list.noinferiors, state, isparent); } } while (rc == IMAP_CMD_CONTINUE); adata->cmddata = NULL; - FREE(&mx.mbox); return (rc == IMAP_CMD_OK) ? 0 : -1; }