Skip to content
Permalink
Browse files Browse the repository at this point in the history
Quote path in imap_subscribe
  • Loading branch information
jeriko-one authored and flatcap committed Jul 7, 2018
1 parent 51c4efb commit 95e80bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imap/imap.c
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit 95e80bf

Please sign in to comment.