aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-11-01 02:11:13 +0800
committerHans Petter <hansp@src.gnome.org>2003-11-01 02:11:13 +0800
commitb4dcb8632fb591b58c8363132715eb4e723cc3c1 (patch)
tree9ec3f4b6d87a3a5a7dff7ed85be604838f52c419 /e-util
parent24557bc3bfbf5d02345536e2b1d53bd33140d91b (diff)
downloadgsoc2013-evolution-b4dcb8632fb591b58c8363132715eb4e723cc3c1.tar.gz
gsoc2013-evolution-b4dcb8632fb591b58c8363132715eb4e723cc3c1.tar.zst
gsoc2013-evolution-b4dcb8632fb591b58c8363132715eb4e723cc3c1.zip
Don't compress trailing slashes in URI elements.
2003-10-31 Hans Petter Jansson <hpj@ximian.com> * e-source.c (e_source_get_uri): Don't compress trailing slashes in URI elements. svn path=/trunk/; revision=23155
Diffstat (limited to 'e-util')
-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;
}