From 8a6070b2908535e7c812df27725470c5051098ef Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Sat, 10 Jan 2009 17:47:29 -0800 Subject: [PATCH] Prioritize the entered IMAP folder delimiter. First priority is the connection delimiter. Second priority is the user's delimiter if it is in imap_delim_chars. We no longer use the first character in imap_delim_chars. --- imap/util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/imap/util.c b/imap/util.c index 45e5673ba..2a5899856 100644 --- a/imap/util.c +++ b/imap/util.c @@ -393,19 +393,19 @@ char *imap_fix_path (IMAP_DATA *idata, char *mailbox, char *path, size_t plen) { int i = 0; - char delim; + char delim = '\0'; if (idata) delim = idata->delim; - else if (ImapDelimChars && ImapDelimChars[0]) - delim = ImapDelimChars[0]; - else - delim = '/'; while (mailbox && *mailbox && i < plen - 1) { - if (strchr(ImapDelimChars, *mailbox) || *mailbox == delim) + if (ImapDelimChars && strchr(ImapDelimChars, *mailbox) || *mailbox == delim) { + /* use connection delimiter if known. Otherwise use user delimiter */ + if (!delim) + delim = *mailbox; + while (*mailbox && (strchr(ImapDelimChars, *mailbox) || *mailbox == delim)) mailbox++; -- 2.40.0