aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-utils.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-08-10 18:38:00 +0800
committerXan Lopez <xan@gnome.org>2009-08-10 18:38:00 +0800
commit44706a1d0bc863eb6ffd9e14a207c230e9d3a028 (patch)
tree0da2158bb114f8008c02eff2cd13e01d437bff12 /embed/ephy-embed-utils.c
parentcc3b8a8703c4ace932dc31680bbb0c3d1ce4829a (diff)
downloadgsoc2013-epiphany-44706a1d0bc863eb6ffd9e14a207c230e9d3a028.tar.gz
gsoc2013-epiphany-44706a1d0bc863eb6ffd9e14a207c230e9d3a028.tar.zst
gsoc2013-epiphany-44706a1d0bc863eb6ffd9e14a207c230e9d3a028.zip
Move URL normalization into a utility function
Diffstat (limited to 'embed/ephy-embed-utils.c')
-rw-r--r--embed/ephy-embed-utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index a5c77a782..0405de744 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -95,3 +95,18 @@ ephy_embed_utils_address_has_web_scheme (const char *address)
return has_web_scheme;
}
+
+char*
+ephy_embed_utils_normalize_address (const char *address)
+{
+ char *effective_address;
+
+ g_return_val_if_fail (address, NULL);
+
+ if (ephy_embed_utils_address_has_web_scheme (address) == FALSE)
+ effective_address = g_strconcat ("http://", address, NULL);
+ else
+ effective_address = g_strdup (address);
+
+ return effective_address;
+}