From 545c3e8a64626dd516d9a5f044b080fea946536a Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 15 Aug 2001 02:48:00 +0000 Subject: Canonicalize store->namespace to end in store->dir_sep, once both values 2001-08-14 Peter Williams * providers/imap/camel-imap-store.c (imap_connect_online): Canonicalize store->namespace to end in store->dir_sep, once both values are known. The %F-related code makes this assumption. Probably fixes a bug reported on the mailing list. svn path=/trunk/; revision=12040 --- camel/ChangeLog | 7 +++++++ camel/providers/imap/camel-imap-store.c | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index b9169dc7c9..a5563925de 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-08-14 Peter Williams + + * providers/imap/camel-imap-store.c (imap_connect_online): + Canonicalize store->namespace to end in store->dir_sep, once both + values are known. The %F-related code makes this + assumption. Probably fixes a bug reported on the mailing list. + 2001-08-13 Jeffrey Stedfast * camel-store.c (camel_store_get_folder): After talking to NotZed, diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index eb0c61e0f8..1260cb58b2 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -646,7 +646,17 @@ imap_connect_online (CamelService *service, CamelException *ex) if (!store->dir_sep) store->dir_sep = '/'; /* Guess */ } - + + /* canonicalize the namespace to end with dir_sep */ + len = strlen (store->namespace); + if (store->namespace[len] != store->dir_sep) { + gchar *tmp; + + tmp = g_strdup_printf ("%s%c", store->namespace, store->dir_sep); + g_free (store->namespace); + store->namespace = tmp; + } + /* Write namespace/separator out */ camel_file_util_encode_string (storeinfo, store->namespace); camel_file_util_encode_uint32 (storeinfo, store->dir_sep); -- cgit v1.2.3