aboutsummaryrefslogtreecommitdiffstats
path: root/camel/url-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/url-util.c')
-rw-r--r--camel/url-util.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/camel/url-util.c b/camel/url-util.c
index da47e041d9..37a433888d 100644
--- a/camel/url-util.c
+++ b/camel/url-util.c
@@ -124,10 +124,15 @@ Gurl *g_url_new (const gchar* url_string)
g_url->port = NULL;
}
- if (slash && *(slash + 1))
- g_url->path = g_strdup (slash);
- else
- g_url->path = NULL;
+ /* setup a fallback, if relative, then empty string, else
+ it will be from root */
+ if (slash == NULL) {
+ slash = "/";
+ }
+ if (slash && *slash && g_url->protocol == NULL)
+ slash++;
+
+ g_url->path = g_strdup (slash);
return g_url;
}