From 1f08629a4f6a7e38568710bbfc3191d36aa649bf Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 30 Jan 2011 18:43:28 +0100 Subject: [PATCH] Preserve %20 for pasting URLs into other windows --- midori/sokoke.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index 4e4aa092..0e39ce8d 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -828,7 +828,7 @@ sokoke_magic_uri (const gchar* uri) * sokoke_uri_unescape_string: * @uri: an URI string * - * Unescape @uri if needed, and pass through '+'. + * Unescape @uri if needed, and pass through '+' and '%20'. * * Return value: a newly allocated URI **/ @@ -836,7 +836,14 @@ gchar* sokoke_uri_unescape_string (const gchar* uri) { if (strchr (uri,'%')) - return g_uri_unescape_string (uri, "+"); + { + /* Preserve %20 for pasting URLs into other windows */ + gchar* unescaped = g_uri_unescape_string (uri, "+"); + gchar* spaced = sokoke_replace_variables (unescaped, " ", "%20", NULL); + g_free (unescaped); + return spaced; + } + return g_strdup (uri); } -- 2.39.5