diff options
Diffstat (limited to 'imap/browse.c')
-rw-r--r-- | imap/browse.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/imap/browse.c b/imap/browse.c index 284ba2dd..daf02a2f 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -42,6 +42,7 @@ int imap_browse (char* path, struct browser_state* state) { IMAP_DATA* idata; char buf[LONG_STRING]; + char buf2[LONG_STRING]; char nsbuf[LONG_STRING]; char mbox[LONG_STRING]; char list_cmd[5]; @@ -154,7 +155,7 @@ int imap_browse (char* path, struct browser_state* state) if (showparents) { - dprint (2, (debugfile, "imap_init_browse: adding parent %s\n", mbox)); + dprint (3, (debugfile, "imap_init_browse: adding parent %s\n", mbox)); imap_add_folder (idata->delim, mbox, 1, 0, state, 1); } @@ -198,14 +199,18 @@ int imap_browse (char* path, struct browser_state* state) /* Listing the home namespace, so INBOX should be included. Home * namespace is not "", so we have to list it explicitly. We ask the * server to see if it has descendants. */ - dprint (4, (debugfile, "imap_init_browse: adding INBOX\n")); + dprint (3, (debugfile, "imap_browse: adding INBOX\n")); if (browse_add_list_result (idata, "LIST \"\" \"INBOX\"", state, 0)) goto fail; } nsup = state->entrylen; - snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"", list_cmd, mbox); + dprint (3, (debugfile, "imap_browse: Quoting mailbox scan: %s -> ", mbox)); + snprintf (buf, sizeof (buf), "%s%%", mbox); + imap_quote_string (buf2, sizeof (buf2), buf); + dprint (3, (debugfile, "%s\n", buf2)); + snprintf (buf, sizeof (buf), "%s \"\" %s", list_cmd, buf2); if (browse_add_list_result (idata, buf, state, 0)) goto fail; @@ -219,7 +224,7 @@ int imap_browse (char* path, struct browser_state* state) if (nsi[i].listable && !nsi[i].home_namespace) { imap_add_folder(nsi[i].delim, nsi[i].prefix, nsi[i].noselect, nsi[i].noinferiors, state, 0); - dprint (4, (debugfile, "imap_init_browse: adding namespace: %s\n", + dprint (3, (debugfile, "imap_browse: adding namespace: %s\n", nsi[i].prefix)); } } |