aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-14 04:53:58 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-14 04:53:58 +0800
commit636c862c7aa0be1dca505032225e3601ae2e219b (patch)
treee0f09e9c9773b89d681c8e3e32c5ff0a1fc7ead1 /camel
parent17ce73241195003a3bedd2fad88288e4350a6ec5 (diff)
downloadgsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.tar
gsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.tar.gz
gsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.tar.bz2
gsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.tar.lz
gsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.tar.xz
gsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.tar.zst
gsoc2013-evolution-636c862c7aa0be1dca505032225e3601ae2e219b.zip
Rearranged some error checking code to fix bug #56405.
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. svn path=/trunk/; revision=25448
Diffstat (limited to 'camel')
-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 d01fd2a9b5..6ad5407bc5 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 5b083972be..58e60cd1a7 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;