diff options
| author | Matthew Barnes <mbarnes@redhat.com> | 2013-08-27 10:00:10 -0400 |
|---|---|---|
| committer | Matthew Barnes <mbarnes@redhat.com> | 2013-08-27 10:06:36 -0400 |
| commit | 207fbc3ea4b0cae2565f2c43d70335cfdba7d573 (patch) | |
| tree | cfb40b85c084a2c88c0e8e4b9b684c981bb69da9 /camel/camel-imapx-store.c | |
| parent | afbed053355109e41a913cbba84c416b4264e3cb (diff) | |
| download | evolution-data-server-207fbc3ea4b0cae2565f2c43d70335cfdba7d573.tar.gz | |
camel_imapx_server_list: Pass the LIST pattern verbatim.
The pattern string passed to camel_imapx_server_list() should already be
UTF-7 encoded with any desired wildcards. The pattern string is used in
the LIST or LSUB command verbatim.
Diffstat (limited to 'camel/camel-imapx-store.c')
| -rw-r--r-- | camel/camel-imapx-store.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c index bce7033a4..8994bc47d 100644 --- a/camel/camel-imapx-store.c +++ b/camel/camel-imapx-store.c @@ -1244,17 +1244,16 @@ fetch_folders_for_namespaces (CamelIMAPXStore *imapx_store, gchar *pat; if (pattern != NULL) - pat = g_strdup (pattern); + pat = g_strdup_printf ("%s*", pattern); else if (*ns->prefix != '\0') pat = g_strdup_printf ( - "%s%c", ns->prefix, ns->sep); + "%s%c*", ns->prefix, ns->sep); else - pat = g_strdup (""); + pat = g_strdup ("*"); if (sync) flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST; - flags |= CAMEL_STORE_FOLDER_INFO_RECURSIVE; success = fetch_folders_for_pattern ( imapx_store, server, pat, flags, list_ext, folders, cancellable, error); @@ -1574,7 +1573,7 @@ imapx_store_get_folder_info_sync (CamelStore *store, CamelStoreSummary *store_summary; gboolean initial_setup = FALSE; gboolean use_subscriptions; - gchar *pattern; + gchar *pattern = NULL; service = CAMEL_SERVICE (store); imapx_store = CAMEL_IMAPX_STORE (store); @@ -1635,7 +1634,6 @@ imapx_store_get_folder_info_sync (CamelStore *store, if (*top) { gchar *mailbox; - gint i; mailbox = camel_imapx_store_summary_mailbox_from_path ( imapx_store->summary, top); @@ -1643,14 +1641,10 @@ imapx_store_get_folder_info_sync (CamelStore *store, mailbox = camel_imapx_store_summary_path_to_mailbox ( imapx_store->summary, top, imapx_store->dir_sep); - - i = strlen (mailbox); - pattern = g_alloca (i + 5); - strcpy (pattern, mailbox); + pattern = camel_utf8_utf7 (mailbox); g_free (mailbox); } else { - pattern = g_alloca (1); - pattern[0] = '\0'; + pattern = g_strdup (""); } if (!sync_folders (imapx_store, pattern, TRUE, cancellable, error)) @@ -1667,6 +1661,8 @@ imapx_store_get_folder_info_sync (CamelStore *store, exit: g_mutex_unlock (&imapx_store->priv->get_finfo_lock); + g_free (pattern); + return fi; } |
