aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-11-03 04:30:22 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-11-03 04:30:22 +0800
commit97b72817a51cfa9d80c189c80d56e92e4f4e72b7 (patch)
tree2567fbc6e36341f4dd1996ef38153864abf3bd31
parent5cf01dc46e0f95d9b327bcf67d478548954abbb6 (diff)
downloadgsoc2013-evolution-97b72817a51cfa9d80c189c80d56e92e4f4e72b7.tar.gz
gsoc2013-evolution-97b72817a51cfa9d80c189c80d56e92e4f4e72b7.tar.zst
gsoc2013-evolution-97b72817a51cfa9d80c189c80d56e92e4f4e72b7.zip
Don't bother getting the folder delim if the name is "" since we don't
2004-11-02 Jeffrey Stedfast <fejj@novell.com> * providers/imap4/camel-imap4-store.c (imap4_folder_utf7_name): Don't bother getting the folder delim if the name is "" since we don't need it in that case. * providers/imap4/camel-imap4-utils.c (camel_imap4_get_path_delim): add an assert that s->namespaces is non-NULL. svn path=/trunk/; revision=27804
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/providers/imap4/camel-imap4-store.c30
-rw-r--r--camel/providers/imap4/camel-imap4-utils.c3
3 files changed, 22 insertions, 19 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 455c704c5a..61e4fb639d 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,8 +1,12 @@
2004-11-02 Jeffrey Stedfast <fejj@novell.com>
+ * providers/imap4/camel-imap4-store.c (imap4_folder_utf7_name):
+ Don't bother getting the folder delim if the name is "" since we
+ don't need it in that case.
+
* providers/imap4/camel-imap4-utils.c
- (camel_imap4_get_path_delim): If namespaces is NULL, return the
- default folder delim ('/').
+ (camel_imap4_get_path_delim): add an assert that s->namespaces is
+ non-NULL.
* providers/imap4/camel-imap4-stream.c
(camel_imap4_stream_literal): Update stream->inptr after fetching
diff --git a/camel/providers/imap4/camel-imap4-store.c b/camel/providers/imap4/camel-imap4-store.c
index 37c203479e..adf8ffbbe4 100644
--- a/camel/providers/imap4/camel-imap4-store.c
+++ b/camel/providers/imap4/camel-imap4-store.c
@@ -592,26 +592,26 @@ static char *
imap4_folder_utf7_name (CamelStore *store, const char *folder_name, char wildcard)
{
char *real_name, *p;
- char sep;
+ char sep = '\0';
int len;
- sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, folder_name);
-
- if (sep != '/') {
- p = real_name = g_alloca (strlen (folder_name) + 1);
- strcpy (real_name, folder_name);
- while (*p != '\0') {
- if (*p == '/')
- *p = sep;
- p++;
+ if (*folder_name) {
+ sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, folder_name);
+
+ if (sep != '/') {
+ p = real_name = g_alloca (strlen (folder_name) + 1);
+ strcpy (real_name, folder_name);
+ while (*p != '\0') {
+ if (*p == '/')
+ *p = sep;
+ p++;
+ }
+
+ folder_name = real_name;
}
- folder_name = real_name;
- }
-
- if (*folder_name)
real_name = camel_utf8_utf7 (folder_name);
- else
+ } else
real_name = g_strdup ("");
if (wildcard) {
diff --git a/camel/providers/imap4/camel-imap4-utils.c b/camel/providers/imap4/camel-imap4-utils.c
index c95438e95a..29ffb945fe 100644
--- a/camel/providers/imap4/camel-imap4-utils.c
+++ b/camel/providers/imap4/camel-imap4-utils.c
@@ -144,8 +144,7 @@ camel_imap4_get_path_delim (CamelIMAP4StoreSummary *s, const char *full_name)
size_t len;
char *top;
- if (s->namespaces == NULL)
- return '/';
+ g_return_val_if_fail (s->namespaces != NULL, '/');
if ((slash = strchr (full_name, '/')))
len = (slash - full_name);