[Xfce4-commits] <midori:master> Escape and unescape for unique and never otherwise
Christian Dywan
noreply at xfce.org
Sun Dec 11 03:30:01 CET 2011
Updating branch refs/heads/master
to b874009e00ce7ead46224ba1b3385cac4c922d91 (commit)
from c8b19b2eebf14e328955c662ad86265dad310e08 (commit)
commit b874009e00ce7ead46224ba1b3385cac4c922d91
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Dec 11 03:27:02 2011 +0100
Escape and unescape for unique and never otherwise
Also don't bother to apply magic when receiving the command,
it was already applied before.
midori/main.c | 17 ++++++++---------
midori/midori-app.c | 4 +---
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/midori/main.c b/midori/main.c
index 614713c..34cfda9 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1524,7 +1524,7 @@ midori_prepare_uri (const gchar *uri)
if (g_path_is_absolute (uri))
return g_filename_to_uri (uri, NULL, NULL);
else if (g_str_has_prefix(uri, "javascript:"))
- return g_strdup (uri);
+ return NULL;
else if (g_file_test (uri, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
{
gchar* current_dir = g_get_current_dir ();
@@ -1534,11 +1534,7 @@ midori_prepare_uri (const gchar *uri)
return uri_ready;
}
- uri_ready = sokoke_magic_uri (uri);
- if (uri_ready)
- return midori_uri_to_ascii (uri_ready);
-
- return midori_uri_to_ascii (uri);
+ return sokoke_magic_uri (uri);
}
#ifdef HAVE_SIGNAL_H
@@ -2237,7 +2233,7 @@ main (int argc,
{
gchar* tmp_uri = midori_prepare_uri (webapp);
midori_browser_set_action_visible (browser, "Menubar", FALSE);
- midori_browser_add_uri (browser, tmp_uri);
+ midori_browser_add_uri (browser, tmp_uri ? tmp_uri : webapp);
g_object_set (settings, "homepage", tmp_uri, NULL);
g_free (tmp_uri);
@@ -2314,7 +2310,10 @@ main (int argc,
while (uris[i] != NULL)
{
gchar* new_uri = midori_prepare_uri (uris[i]);
- katze_assign (uris[i], new_uri);
+ gchar* escaped_uri = g_uri_escape_string (
+ new_uri ? new_uri : uris[i], NULL, FALSE);
+ g_free (new_uri);
+ katze_assign (uris[i], escaped_uri);
i++;
}
result = midori_app_instance_send_uris (app, uris);
@@ -2487,7 +2486,7 @@ main (int argc,
{
item = katze_item_new ();
uri_ready = midori_prepare_uri (uri);
- katze_item_set_uri (item, uri_ready);
+ katze_item_set_uri (item, uri_ready ? uri_ready : uri);
g_free (uri_ready);
/* Never delay command line arguments */
katze_item_set_meta_integer (item, "delay", 0);
diff --git a/midori/midori-app.c b/midori/midori-app.c
index d8502a1..0666e6f 100644
--- a/midori/midori-app.c
+++ b/midori/midori-app.c
@@ -506,9 +506,7 @@ midori_app_command_received (MidoriApp* app,
first = (open_external_pages_in == MIDORI_NEW_PAGE_CURRENT);
while (*uris)
{
- gchar* fixed_uri = sokoke_magic_uri (*uris);
- if (!fixed_uri)
- fixed_uri = g_strdup (*uris);
+ gchar* fixed_uri = g_uri_unescape_string (*uris, NULL);
if (sokoke_recursive_fork_protection (fixed_uri, FALSE))
{
if (first)
More information about the Xfce4-commits
mailing list