]> spindle.queued.net Git - midori/commitdiff
Properly pass external addresses with libSoup 2.27.90
authorChristian Dywan <christian@twotoasts.de>
Thu, 8 Oct 2009 20:30:24 +0000 (22:30 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 9 Oct 2009 12:21:55 +0000 (14:21 +0200)
midori/main.c
midori/sokoke.c
midori/sokoke.h

index 834e47d5026daa949e2e9caa5d02c81f2479e3f6..a8400f39af40c5b99a68b323eb6088cb54830d2b 100644 (file)
@@ -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
index 2a9d966b86cf7dfe1d99360df990bb468ae90592..1b986ca24590a49997ca8ffd445154c65c87cf2e 100644 (file)
@@ -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)
 {
index 15f2c882c6495b747bdbfabbfb9fa32412a74000..854b0c332c5645736f31486205bdce86ecef2d67 100644 (file)
@@ -41,6 +41,10 @@ sokoke_spawn_program                    (const gchar*    command,
 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);