]> granicus.if.org Git - neomutt/commitdiff
Quote path in imap_subscribe
authorJerikoOne <jeriko.one@gmx.us>
Sat, 7 Jul 2018 01:50:14 +0000 (20:50 -0500)
committerRichard Russon <rich@flatcap.org>
Sat, 7 Jul 2018 09:46:40 +0000 (10:46 +0100)
imap/imap.c

index 40f620a2e2bf91b34edf289784e01867ef78d830..f1706885620c7afd61bdc5bd03593557980bd0ab 100644 (file)
@@ -1709,6 +1709,7 @@ int imap_subscribe(char *path, bool subscribe)
   char errstr[STRING];
   struct Buffer err, token;
   struct ImapMbox mx;
+  size_t len = 0;
 
   if (!mx_is_imap(path) || imap_parse_path(path, &mx) || !mx.mbox)
   {
@@ -1729,7 +1730,8 @@ int imap_subscribe(char *path, bool subscribe)
     mutt_buffer_init(&err);
     err.data = errstr;
     err.dsize = sizeof(errstr);
-    snprintf(mbox, sizeof(mbox), "%smailboxes \"%s\"", subscribe ? "" : "un", path);
+       len = snprintf(mbox, sizeof(mbox), "%smailboxes ", subscribe ? "" : "un");
+       imap_quote_string(mbox + len, sizeof(mbox) - len, path, true);
     if (mutt_parse_rc_line(mbox, &token, &err))
       mutt_debug(1, "Error adding subscribed mailbox: %s\n", errstr);
     FREE(&token.data);