[Xfce4-commits] <midori:master> Only split URI if no domain pattern is found in the string

Christian Dywan noreply at xfce.org
Wed Feb 10 19:54:02 CET 2010


Updating branch refs/heads/master
         to 0243e26bed5d937ab95f81a8783a52b0896dfc49 (commit)
       from 060c0b69407dc99caa996dd155d9b91a463fdccc (commit)

commit 0243e26bed5d937ab95f81a8783a52b0896dfc49
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Feb 8 23:02:54 2010 +0100

    Only split URI if no domain pattern is found in the string

 midori/sokoke.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/midori/sokoke.c b/midori/sokoke.c
index 62a7a1a..c497b23 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -622,18 +622,21 @@ sokoke_magic_uri (const gchar* uri,
         return sokoke_idn_to_punycode (g_strconcat ("http://", uri, NULL));
     if (!strncmp (uri, "localhost", 9) && (uri[9] == '\0' || uri[9] == '/'))
         return g_strconcat ("http://", uri, NULL);
-    parts = g_strsplit (uri, ".", 0);
-    if (!search && parts[0] && parts[1])
+    if (!search)
     {
-        if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0])))
-            if (!strchr (parts[0], ' ') && !strchr (parts[1], ' '))
-            {
-                search = g_strconcat ("http://", uri, NULL);
-                g_strfreev (parts);
-                return sokoke_idn_to_punycode (search);
-            }
+        parts = g_strsplit (uri, ".", 0);
+        if (parts[0] && parts[1])
+        {
+            if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0])))
+                if (!strchr (parts[0], ' ') && !strchr (parts[1], ' '))
+                {
+                    search = g_strconcat ("http://", uri, NULL);
+                    g_strfreev (parts);
+                   return sokoke_idn_to_punycode (search);
+                }
+        }
+        g_strfreev (parts);
     }
-    g_strfreev (parts);
     /* We don't want to search? So return early. */
     if (!search_engines)
         return g_strdup (uri);



More information about the Xfce4-commits mailing list