From a7847127e47ac3d6e1ff0d49efdb199d08e0eb3c Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Mon, 12 Mar 2007 10:32:35 -0700 Subject: [PATCH] Substitute INBOX for empty mailbox _after_ cleanup (closes: #2841) --- imap/util.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/imap/util.c b/imap/util.c index 6802bde3..b2e85dfc 100644 --- a/imap/util.c +++ b/imap/util.c @@ -295,12 +295,6 @@ char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path, { int x = 0; - if (!mailbox || !*mailbox) - { - strfcpy (path, "INBOX", plen); - return path; - } - while (mailbox && *mailbox && (x < (plen - 1))) { if ((*mailbox == '/') || (*mailbox == idata->delim)) @@ -318,6 +312,10 @@ char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path, if (x && path[--x] != idata->delim) x++; path[x] = '\0'; + + if (!path[0]) + strfcpy (path, "INBOX", plen); + return path; } -- 2.40.0