aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-selector.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-folder-selector.c')
-rw-r--r--mail/em-folder-selector.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index d317635ee1..4d2c771f86 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -357,8 +357,15 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
camel_url_set_fragment (url, newpath);
} else {
- newpath = g_strdup_printf("%s/%s", (url->path == NULL || strcmp(url->path, "/") == 0) ? "":url->path, name);
+ char *path;
+
+ path = g_strdup_printf("%s/%s", (url->path == NULL || strcmp(url->path, "/") == 0) ? "":url->path, name);
camel_url_set_path(url, newpath);
+ if (path[0] == '/') {
+ newpath = g_strdup(path+1);
+ g_free(path);
+ } else
+ newpath = path;
}
g_free (emfs->selected_path);
@@ -406,7 +413,7 @@ em_folder_selector_get_selected_path (EMFolderSelector *emfs)
char *newpath;
name = gtk_entry_get_text (emfs->name_entry);
- if (strcmp (path, "/") != 0)
+ if (strcmp (path, "") != 0)
newpath = g_strdup_printf ("%s/%s", path, name);
else
newpath = g_strdup_printf ("/%s", name);