From 6122b68bb1c0dad56fda839f6f7b2e90c7ff03ca Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 30 Sep 2002 22:57:42 +0000 Subject: Fixes bug #31456. 2002-09-30 Jeffrey Stedfast Fixes bug #31456. * providers/imap/camel-imap-store.c (imap_connect_online): Don't LSUB "" "*", instead get both an LSUB containing the subfolders of the namespace and an LSUB of INBOX (assuming namespace was non-empty). This fix really has nothing to do with bug #31456 but is what should have been done in the first place. (parse_list_response_as_folder_info): Simplify a tad and strip extra leading /'s from fi->path. (imap_build_folder_info): Strip extra leading /'s from fi->path. * camel-store.c (camel_folder_info_build): Don't strip the namespace from the fi->full_name when hashing or creating fake parent folder-infos. Fixes a bug I found while trying to reproduce bug #31456. (camel_folder_info_build_path): Strip off extra leading dir_sep chars from the path. svn path=/trunk/; revision=18273 --- camel/camel-store.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'camel/camel-store.c') diff --git a/camel/camel-store.c b/camel/camel-store.c index f7ae7cba78..43528a8353 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -818,13 +818,19 @@ camel_folder_info_free (CamelFolderInfo *fi) void camel_folder_info_build_path (CamelFolderInfo *fi, char separator) { - fi->path = g_strdup_printf("/%s", fi->full_name); + const char *full_name; + char *p; + + full_name = fi->full_name; + while (*full_name == separator) + full_name++; + + fi->path = g_strdup_printf ("/%s", full_name); if (separator != '/') { - char *p; - - p = fi->path; - while ((p = strchr (p, separator))) - *p = '/'; + for (p = fi->path; *p; p++) { + if (*p == separator) + *p = '/'; + } } } -- cgit