From 0960633750653e6192986b3657eaf051cdf62174 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 22 Sep 2000 22:35:10 +0000 Subject: Again...wrap the folder names in quotes 2000-09-22 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_get_message_count_internal): Again...wrap the folder names in quotes * providers/imap/camel-imap-store.c (imap_folder_exists): Wrap the mailbox name in the LIST command in quotes just in case the folder has spaces in the name. (imap_create): Again, wrap folder name in quotes. (check_current_folder): Same... * providers/imap/camel-imap-utils.c (imap_parse_list_response): Update to unquote mailbox if it's quoted (allows us to get folders with spaces in the name). svn path=/trunk/; revision=5556 --- camel/providers/imap/camel-imap-folder.c | 4 ++-- camel/providers/imap/camel-imap-store.c | 6 +++--- camel/providers/imap/camel-imap-utils.c | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 7d744d701d..9664dab008 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -314,10 +314,10 @@ imap_get_message_count_internal (CamelFolder *folder, CamelException *ex) if (store->has_status_capability) status = camel_imap_command_extended (store, folder, &result, ex, - "STATUS %s (MESSAGES)", folder_path); + "STATUS \"%s\" (MESSAGES)", folder_path); else status = camel_imap_command_extended (store, folder, &result, ex, - "EXAMINE %s", folder_path); + "EXAMINE \"%s\"", folder_path); g_free (folder_path); diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 853059b618..b6748f62cc 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -345,7 +345,7 @@ imap_folder_exists (CamelImapStore *store, const char *folder_path, gboolean *se *selectable = FALSE; status = camel_imap_command_extended (CAMEL_IMAP_STORE (store), NULL, - &result, ex, "LIST \"\" %s", folder_path); + &result, ex, "LIST \"\" \"%s\"", folder_path); if (status != CAMEL_IMAP_OK) { g_free (result); return FALSE; @@ -375,7 +375,7 @@ imap_create (CamelImapStore *store, const char *folder_path, CamelException *ex) gint status; status = camel_imap_command_extended (store, NULL, NULL, ex, - "CREATE %s", folder_path); + "CREATE \"%s\"", folder_path); return status == CAMEL_IMAP_OK; } @@ -495,7 +495,7 @@ check_current_folder (CamelImapStore *store, CamelFolder *folder, char *fmt, Cam return CAMEL_IMAP_OK; folder_path = camel_imap_store_folder_path (store, folder->full_name); - status = camel_imap_command_extended (store, NULL, NULL, ex, "SELECT %s", folder_path); + status = camel_imap_command_extended (store, NULL, NULL, ex, "SELECT \"%s\"", folder_path); g_free (folder_path); if (status != CAMEL_IMAP_OK) { diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c index 8fdc4fb5b4..925ae13891 100644 --- a/camel/providers/imap/camel-imap-utils.c +++ b/camel/providers/imap/camel-imap-utils.c @@ -36,13 +36,13 @@ char * imap_next_word (char *buf) { char *word; - + /* skip over current word */ for (word = buf; *word && *word != ' '; word++); - + /* skip over white space */ for ( ; *word && *word == ' '; word++); - + return word; } @@ -92,6 +92,7 @@ imap_parse_list_response (char *buf, char *namespace, char **flags, char **sep, word = imap_next_word (word); *folder = g_strdup (word); g_strstrip (*folder); + string_unquote (*folder); /* chop out the folder prefix */ if (*namespace && !strncmp (*folder, namespace, strlen (namespace))) { -- cgit v1.2.3