From 537d002a6f939d262aa58dc7659f5a0aa00979b0 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 8 Mar 2012 00:46:38 +0100 Subject: [PATCH] Unify file handling in midori_prepare_uri and magic_uri --- midori/main.c | 4 +--- midori/sokoke.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/midori/main.c b/midori/main.c index deda05fa..7345dcb4 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1513,9 +1513,7 @@ midori_prepare_uri (const gchar *uri) { gchar* uri_ready; - if (g_path_is_absolute (uri)) - return g_filename_to_uri (uri, NULL, NULL); - else if (g_str_has_prefix(uri, "javascript:")) + if (g_str_has_prefix(uri, "javascript:")) return NULL; else if (g_file_test (uri, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) { diff --git a/midori/sokoke.c b/midori/sokoke.c index 23a97b1d..b25a3dd0 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -651,7 +651,7 @@ sokoke_magic_uri (const gchar* uri) /* Add file:// if we have a local path */ if (g_path_is_absolute (uri)) - return g_strconcat ("file://", uri, NULL); + return g_filename_to_uri (uri, NULL, NULL); /* Parse geo URI geo:48.202778,16.368472;crs=wgs84;u=40 as a location */ if (!strncmp (uri, "geo:", 4)) { -- 2.39.5