Skip to content

Commit 95e80bf

Browse files
jeriko-oneflatcap
authored andcommitted
Quote path in imap_subscribe
1 parent 51c4efb commit 95e80bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: imap/imap.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,7 @@ int imap_subscribe(char *path, bool subscribe)
17091709
char errstr[STRING];
17101710
struct Buffer err, token;
17111711
struct ImapMbox mx;
1712+
size_t len = 0;
17121713

17131714
if (!mx_is_imap(path) || imap_parse_path(path, &mx) || !mx.mbox)
17141715
{
@@ -1729,7 +1730,8 @@ int imap_subscribe(char *path, bool subscribe)
17291730
mutt_buffer_init(&err);
17301731
err.data = errstr;
17311732
err.dsize = sizeof(errstr);
1732-
snprintf(mbox, sizeof(mbox), "%smailboxes \"%s\"", subscribe ? "" : "un", path);
1733+
len = snprintf(mbox, sizeof(mbox), "%smailboxes ", subscribe ? "" : "un");
1734+
imap_quote_string(mbox + len, sizeof(mbox) - len, path, true);
17331735
if (mutt_parse_rc_line(mbox, &token, &err))
17341736
mutt_debug(1, "Error adding subscribed mailbox: %s\n", errstr);
17351737
FREE(&token.data);

0 commit comments

Comments
 (0)