summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-13 20:53:58 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-13 20:53:58 +0000
commit895f347c0d535a71978ab50424c096fa91c3e447 (patch)
tree55409fa2998ed4f606fb6e50ca734a3570b7966e
parent6762130252dfe154e1b6de9e37a505001183a270 (diff)
downloadevolution-data-server-evolution_1_5_7.tar.gz
Rearranged some error checking code to fix bug #56405.evolution_1_5_7
2004-04-13 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (get_folder_online): Rearranged some error checking code to fix bug #56405.
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/imap/camel-imap-store.c21
2 files changed, 16 insertions, 10 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d01fd2a9b..6ad5407bc 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-13 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/imap/camel-imap-store.c (get_folder_online):
+ Rearranged some error checking code to fix bug #56405.
+
2004-04-13 Not Zed <NotZed@Ximian.com>
* camel-folder.c (folder_getv): implement the new counts, and get
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 5b083972b..58e60cd1a 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -524,8 +524,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE
int port, ret;
char *buf;
- h = camel_service_gethost (service, ex);
- if (!h)
+ if (!(h = camel_service_gethost (service, ex)))
return FALSE;
port = service->url->port ? service->url->port : 143;
@@ -1791,7 +1790,14 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
return NULL;
}
- c = folder_name;
+ if ((parent_name = strrchr (folder_name, '/'))) {
+ parent_name = g_strndup (folder_name, parent_name - folder_name);
+ parent_real = camel_imap_store_summary_path_to_full (imap_store->summary, parent_name, store->dir_sep);
+ } else {
+ parent_real = NULL;
+ }
+
+ c = parent_name ? parent_name : folder_name;
while (*c && *c != imap_store->dir_sep && !strchr ("#%*", *c))
c++;
@@ -1800,16 +1806,11 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
_("The folder name \"%s\" is invalid because it contains the character \"%c\""),
folder_name, *c);
+ g_free (parent_name);
+ g_free (parent_real);
return NULL;
}
- if ((parent_name = strrchr (folder_name, '/'))) {
- parent_name = g_strndup (folder_name, parent_name - folder_name);
- parent_real = camel_imap_store_summary_path_to_full (imap_store->summary, parent_name, store->dir_sep);
- } else {
- parent_real = NULL;
- }
-
if (parent_real != NULL) {
gboolean need_convert = FALSE;
char *resp, *thisone;