From: JerikoOne Date: Sat, 7 Jul 2018 01:50:14 +0000 (-0500) Subject: Quote path in imap_subscribe X-Git-Tag: neomutt-20180716~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95e80bf9ff10f68cb6443f760b85df4117cb15eb;p=neomutt Quote path in imap_subscribe --- diff --git a/imap/imap.c b/imap/imap.c index 40f620a2e..f17068856 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -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);