aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-source.c18
2 files changed, 20 insertions, 3 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index cb97b3aa8b..4aa77c2383 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-31 Hans Petter Jansson <hpj@ximian.com>
+
+ * e-source.c (e_source_get_uri): Don't compress trailing slashes in
+ URI elements.
+
2003-10-31 Not Zed <NotZed@Ximian.com>
* e-account.c (e_account_(sg)et_from_xml): add encrypt_key id, and
diff --git a/e-util/e-source.c b/e-util/e-source.c
index cc7742d924..593b770055 100644
--- a/e-util/e-source.c
+++ b/e-util/e-source.c
@@ -420,14 +420,26 @@ e_source_get_color (ESource *source,
char *
e_source_get_uri (ESource *source)
{
+ const gchar *base_uri_str;
+ gchar *uri_str;
+
g_return_val_if_fail (E_IS_SOURCE (source), NULL);
if (source->priv->group == NULL)
return NULL;
- return g_build_filename (e_source_group_peek_base_uri (source->priv->group),
- source->priv->relative_uri,
- NULL);
+ base_uri_str = e_source_group_peek_base_uri (source->priv->group);
+
+ /* If last character in base URI is a dir separator, just concat the strings.
+ * We don't want to compress e.g. the trailing :// in a protocol specification */
+ if (*base_uri_str && *(base_uri_str + strlen (base_uri_str) - 1) == G_DIR_SEPARATOR)
+ uri_str = g_strconcat (base_uri_str, source->priv->relative_uri, NULL);
+ else
+ uri_str = g_build_filename (e_source_group_peek_base_uri (source->priv->group),
+ source->priv->relative_uri,
+ NULL);
+
+ return uri_str;
}