aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 2831f8bc24..613a3b00fa 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -102,18 +102,22 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
} else if (!strncmp(name, "imap:", 5)) {
/* uhm, I'm just guessing here - this code might be wrong */
+ char *service, *ptr;
+
fprintf (stderr, "\n****** name = %s ******\n\n", name);
- store = camel_session_get_store (session, name, ex);
+ service = g_strdup (name);
+ for (ptr = service + 7; *ptr && *ptr != '/'; ptr++);
+ *ptr = '\0';
+ fprintf (stderr, "\n****** service = %s ******\n\n", service);
+ store = camel_session_get_store (session, service, ex);
+ g_free (service);
if (store) {
char *folder_name;
- folder_name = strstr (name, "//");
- if (folder_name) {
- for (folder_name += 2; *folder_name && *folder_name != '/'; folder_name++);
- if (*folder_name) {
- folder_name++;
- new_folder = camel_store_get_folder (store, folder_name, TRUE, ex);
- }
+ for (ptr = name + 7; *ptr && *ptr != '/'; ptr++);
+ if (*ptr == '/') {
+ folder_name = ptr + 1;
+ new_folder = camel_store_get_folder (store, folder_name, TRUE, ex);
}
}
} else if (!strncmp(name, "file:", 5)) {