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
This commit is contained in:
Hans Petter Jansson
2003-10-31 18:11:13 +00:00
committed by Hans Petter
parent 24557bc3bf
commit b4dcb8632f
2 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -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;
}