[Xfce4-commits] <midori:master> Properly pass external addresses with libSoup 2.27.90
Christian Dywan
noreply at xfce.org
Fri Oct 9 15:06:01 CEST 2009
Updating branch refs/heads/master
to 0ac4de8aa561aac53a9f60e9792a0018bedc095e (commit)
from fa8f109da91310589c459bb94ae9c4616574b634 (commit)
commit 0ac4de8aa561aac53a9f60e9792a0018bedc095e
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Oct 8 22:30:24 2009 +0200
Properly pass external addresses with libSoup 2.27.90
midori/main.c | 12 +++++++++---
midori/sokoke.c | 2 +-
midori/sokoke.h | 4 ++++
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/midori/main.c b/midori/main.c
index 834e47d..a8400f3 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1776,13 +1776,19 @@ main (int argc,
i = 0;
while (uris[i] != NULL)
{
- #if GLIB_CHECK_VERSION (2, 22, 0)
- gchar* encoded = g_hostname_to_unicode (uris[i]);
+ #ifdef HAVE_LIBSOUP_2_27_90
+ gchar* path;
+ gchar* hostname = sokoke_hostname_from_uri (uris[i], &path);
+ gchar* encoded = g_hostname_to_ascii (hostname);
+
if (encoded)
{
+ gchar* res = g_strconcat ("http://", encoded, path, NULL);
g_free (uris[i]);
- uris[i] = encoded;
+ g_free (encoded);
+ uris[i] = res;
}
+ g_free (hostname);
#else
uris[i] = sokoke_idn_to_punycode (uris[i]);
#endif
diff --git a/midori/sokoke.c b/midori/sokoke.c
index 2a9d966..1b986ca 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -197,7 +197,7 @@ sokoke_spawn_program (const gchar* command,
*
* Return value: a newly allocated hostname
**/
-static gchar*
+gchar*
sokoke_hostname_from_uri (const gchar* uri,
gchar** path)
{
diff --git a/midori/sokoke.h b/midori/sokoke.h
index 15f2c88..854b0c3 100644
--- a/midori/sokoke.h
+++ b/midori/sokoke.h
@@ -42,6 +42,10 @@ gchar* sokoke_search_uri (const gchar* uri,
const gchar* keywords);
gchar*
+sokoke_hostname_from_uri (const gchar* uri,
+ gchar** path);
+
+gchar*
sokoke_idn_to_punycode (gchar* uri);
gchar*
More information about the Xfce4-commits
mailing list