aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-url.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-07-26 23:13:50 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-07-26 23:13:50 +0800
commit222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4 (patch)
tree770b4a12260c77f1b2f35322b91e33b785a4849d /camel/camel-url.c
parent53f0a7f9e42c3544eaf9f4b70f449b3e1efa299d (diff)
downloadgsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.tar
gsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.tar.gz
gsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.tar.bz2
gsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.tar.lz
gsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.tar.xz
gsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.tar.zst
gsoc2013-evolution-222e4d4b62bb55f2fe32d79b8be9129f0f7ceba4.zip
Should now always prepend a '/' before the path if it doesn't already
2000-07-26 Jeffrey Stedfast <fejj@helixcode.com> * camel-url.c (camel_url_to_string): Should now always prepend a '/' before the path if it doesn't already exist. * providers/imap/camel-imap-folder.c: Fixed a few compiler warnings svn path=/trunk/; revision=4346
Diffstat (limited to 'camel/camel-url.c')
-rw-r--r--camel/camel-url.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 75b7ac985e..bf578a41a5 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -43,7 +43,8 @@
*
* protocol://user;AUTH=mech:password@host:port/path
*
- * The protocol, followed by a ":" is required. If it is followed by * "//", there must be an "authority" containing at least a host,
+ * The protocol, followed by a ":" is required. If it is followed by * "//",
+ * there must be an "authority" containing at least a host,
* which ends at the end of the string or at the next "/". If there
* is an "@" in the authority, there must be a username before it,
* and the host comes after it. The authmech, password, and port are
@@ -193,19 +194,20 @@ camel_url_to_string (CamelURL *url, gboolean show_passwd)
if (url->path)
path = camel_url_encode (url->path, FALSE, NULL);
- return_result = g_strdup_printf ("%s:%s%s%s%s%s%s%s%s%s%s%s",
- url->protocol,
- host ? "//" : "",
- user ? user : "",
- authmech ? ";auth=" : "",
- authmech ? authmech : "",
- passwd ? ":" : "",
- passwd ? passwd : "",
- user ? "@" : "",
- host ? host : "",
- *port ? ":" : "",
- port,
- path ? path : "");
+ return_result = g_strdup_printf ("%s:%s%s%s%s%s%s%s%s%s%s%s%s",
+ url->protocol,
+ host ? "//" : "",
+ user ? user : "",
+ authmech ? ";auth=" : "",
+ authmech ? authmech : "",
+ passwd ? ":" : "",
+ passwd ? passwd : "",
+ user ? "@" : "",
+ host ? host : "",
+ *port ? ":" : "",
+ port,
+ path && *path != '/' ? "/" : "",
+ path ? path : "");
g_free (user);
g_free (authmech);
g_free (passwd);