summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-07-26 15:13:50 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2000-07-26 15:13:50 +0000
commitdc11b1f1c1ce75a87d68546567ec5a515d69dcf7 (patch)
tree64711e720a03aa25056a8cc461e9dd0cc6903658
parentb6617d57f12a646d5315761eb8db2d534190689f (diff)
downloadevolution-data-server-dc11b1f1c1ce75a87d68546567ec5a515d69dcf7.tar.gz
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
-rw-r--r--camel/ChangeLog3
-rw-r--r--camel/camel-url.c30
2 files changed, 19 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 6f87c687a..6e48d24ad 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,8 @@
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
2000-07-25 Jeffrey Stedfast <fejj@helixcode.com>
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 75b7ac985..bf578a41a 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);