aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-06-11 16:30:16 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-06-11 16:30:16 +0800
commit6093cf098260b390980b2a8da34477d1874e5b9c (patch)
tree7b691675b15d9ab82158912f97b2912353962637 /mail/em-utils.c
parentad811c27003b8e8ea0dbdba3cef61823a2497f26 (diff)
downloadgsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.tar
gsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.tar.gz
gsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.tar.bz2
gsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.tar.lz
gsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.tar.xz
gsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.tar.zst
gsoc2013-evolution-6093cf098260b390980b2a8da34477d1874e5b9c.zip
handle a null path or fragment.
2004-06-11 Not Zed <NotZed@Ximian.com> * em-utils.c (em_uri_from_camel): handle a null path or fragment. * em-folder-tree-model.c (em_folder_tree_model_add_store): set the full name of the store to "". Fixes #59925 and probably other issues. Related to the removal of folderinfo->path. svn path=/trunk/; revision=26305
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index c82d2c9636..6cc735e981 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1556,12 +1556,16 @@ char *em_uri_from_camel(const char *curi)
else
uid = account->uid;
path = (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)?curl->fragment:curl->path;
- if (path[0] == '/')
- path++;
+ if (path) {
+ if (path[0] == '/')
+ path++;
- tmp = camel_url_encode(path, ";?");
- euri = g_strdup_printf("email://%s/%s", uid, tmp);
- g_free(tmp);
+ tmp = camel_url_encode(path, ";?");
+ euri = g_strdup_printf("email://%s/%s", uid, tmp);
+ g_free(tmp);
+ } else {
+ euri = g_strdup_printf("email://%s/", uid);
+ }
d(printf("em uri from camel '%s' -> '%s'\n", curi, euri));