aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-10-17 02:10:42 +0800
committerDan Winship <danw@src.gnome.org>2000-10-17 02:10:42 +0800
commitf8e95fb8161a02b064e1170dd3ac77090530f20a (patch)
tree00aab2ef44f6aab24649ebd57283f044d96435d3 /camel/providers/imap
parent6793123da8bf07d588c2b7c403e8d070ef7d3e91 (diff)
downloadgsoc2013-evolution-f8e95fb8161a02b064e1170dd3ac77090530f20a.tar.gz
gsoc2013-evolution-f8e95fb8161a02b064e1170dd3ac77090530f20a.tar.zst
gsoc2013-evolution-f8e95fb8161a02b064e1170dd3ac77090530f20a.zip
Deal with the possibility of not getting a LIST response back for the top
* providers/imap/camel-imap-store.c (get_folder_info): Deal with the possibility of not getting a LIST response back for the top level. svn path=/trunk/; revision=5941
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 1042160868..a561cab96d 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -520,7 +520,7 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
CamelImapResponse *response;
GPtrArray *folders;
char *dir_sep, *namespace, *base_url, *list;
- CamelFolderInfo *topfi, *fi;
+ CamelFolderInfo *topfi = NULL, *fi;
if (!top)
top = "";
@@ -542,19 +542,21 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
response = camel_imap_command (imap_store, NULL, ex,
"LIST \"\" \"%s\"", namespace);
- if (!response) {
- g_free (namespace);
- g_free (base_url);
- return NULL;
+ if (response) {
+ list = camel_imap_response_extract (response, "LIST", ex);
+ if (list) {
+ topfi = parse_list_response_as_folder_info (list,
+ namespace,
+ base_url);
+ g_free (list);
+ }
}
- list = camel_imap_response_extract (response, "LIST", ex);
- if (!list) {
- g_free (namespace);
- g_free (base_url);
- return NULL;
+ if (!topfi) {
+ camel_exception_clear (ex);
+ topfi = g_new0 (CamelFolderInfo, 1);
+ fi->full_name = g_strdup (namespace);
+ fi->name = g_strdup (namespace);
}
- topfi = parse_list_response_as_folder_info (list, namespace, base_url);
- g_free (list);
response = camel_imap_command (imap_store, NULL, ex,
"LIST \"\" \"%s%s%c\"",