]> granicus.if.org Git - neomutt/commitdiff
imap: remove imap_parse_path2() from imap_hcache_open()
authorMehdi Abaakouk <sileht@sileht.net>
Wed, 14 Nov 2018 09:07:37 +0000 (10:07 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 15 Nov 2018 00:26:28 +0000 (00:26 +0000)
imap/util.c

index 55a363c2a3a9c0858370305c4d31d70de6307991..a529d42e89809bd7975e89a274278c27a917260b 100644 (file)
@@ -381,18 +381,16 @@ header_cache_t *imap_hcache_open(struct ImapAccountData *adata, const char *path
   struct Url url;
   char cachepath[PATH_MAX];
   char mbox[PATH_MAX];
-  char buf[PATH_MAX];
 
   if (path)
     imap_cachepath(adata, path, mbox, sizeof(mbox));
-  else
+  else if (adata->mailbox)
   {
-    if (!adata->mailbox ||
-        imap_parse_path2(adata->mailbox->path, NULL, buf, sizeof(buf)) < 0)
-      return NULL;
-
-    imap_cachepath(adata, buf, mbox, sizeof(mbox));
+    struct ImapMailboxData *mdata = imap_mdata_get(adata->mailbox);
+    imap_cachepath(adata, mdata->name, mbox, sizeof(mbox));
   }
+  else
+    return NULL;
 
   if (strstr(mbox, "/../") || (strcmp(mbox, "..") == 0) || (strncmp(mbox, "../", 3) == 0))
     return NULL;