Check URI is valid using SoupURI instead of strcmp.
authorTom Adams <tom@holizz.com>
Sun, 19 Jul 2009 15:06:20 +0000 (16:06 +0100)
committerTom Adams <tom@holizz.com>
Sun, 19 Jul 2009 18:23:02 +0000 (19:23 +0100)
uzbl.c

diff --git a/uzbl.c b/uzbl.c
index 3c7663e..ff1093d 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -952,7 +952,7 @@ load_uri (WebKitWebView *web_view, GArray *argv, GString *result) {
             run_js(web_view, argv, NULL);
             return;
         }
-        if (g_strrstr (argv_idx(argv, 0), "://") == NULL && g_strstr_len (argv_idx(argv, 0), 5, "data:") == NULL)
+        if (!soup_uri_new(argv_idx(argv, 0)))
             g_string_prepend (newuri, "http://");
         /* if we do handle cookies, ask our handler for them */
         webkit_web_view_load_uri (web_view, newuri->str);