diff options
-rw-r--r-- | camel/ChangeLog | 3 | ||||
-rw-r--r-- | camel/camel-filter-driver.c | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 11f3b4c433..d4f1d375bc 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,8 @@ 2001-06-07 Jon Trowbridge <trow@ximian.com> + * camel-filter-driver.c (camel_filter_driver_filter_folder): Add a + separator between the service url and the folder name, if needed. + * camel-filter-driver.c (camel_filter_driver_filter_mbox): Added an argument, so that the original source URI of the mbox can be passed in. This is needed because this function is called diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c index d70798f6f2..83cfb92221 100644 --- a/camel/camel-filter-driver.c +++ b/camel/camel-filter-driver.c @@ -732,10 +732,22 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde CamelMimeMessage *message; CamelMessageInfo *info; char *source_url, *service_url; + const char *folder_name; int status = 0; + int need_sep = 0; service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (folder))); - source_url = g_strdup_printf ("%s%s", service_url, camel_folder_get_full_name (folder)); + folder_name = camel_folder_get_full_name (folder); + + /* Add a separator unless the first char of folder_name or the last char of service_url is '/' */ + need_sep = (folder_name && *folder_name != '/'); + if (service_url && *service_url && !need_sep) { + need_sep = (service_url[strlen (service_url)-1] != '/'); + } + source_url = g_strdup_printf ("%s%s%s", + service_url, + need_sep ? "/" : "", + folder_name); g_free (service_url); if (uids == NULL) { |