From 31dabca224e9248b494e1279010b1649885bda05 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 10 Oct 2010 13:39:38 +0200 Subject: [PATCH] Shell quote URI passed to sokoke_spawn_program --- midori/sokoke.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index 5e7b9a63..e2babcc0 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -443,16 +443,19 @@ sokoke_spawn_program (const gchar* command, { /* FIXME: Implement Hildon specific version */ gchar* uri_format; + gchar* argument_quoted; gchar* command_ready; gchar** argv; if ((uri_format = strstr (command, "%u"))) uri_format[1] = 's'; + argument_quoted = g_shell_quote (argument); if (strstr (command, "%s")) - command_ready = g_strdup_printf (command, argument); + command_ready = g_strdup_printf (command, argument_quoted); else - command_ready = g_strconcat (command, " ", argument, NULL); + command_ready = g_strconcat (command, " ", argument_quoted, NULL); + g_free (argument_quoted); error = NULL; if (!g_shell_parse_argv (command_ready, NULL, &argv, &error)) -- 2.39.5