Skip to content
Permalink
Browse files

Quote path in imap_subscribe

  • Loading branch information...
jeriko-one authored and flatcap committed Jul 7, 2018
1 parent 51c4efb commit 95e80bf9ff10f68cb6443f760b85df4117cb15eb
Showing with 3 additions and 1 deletion.
  1. +3 −1 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);

0 comments on commit 95e80bf

Please sign in to comment.
You can’t perform that action at this time.