From b6247e33149f36fe09e07a2f9d95bdd5e7d4651a Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 3 Oct 2010 07:14:00 +0200 Subject: [PATCH] Shell quote argv[0] before spawning a process The path to the executable may contain spaces. --- midori/midori-browser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index a7192137..8f81ff9a 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2139,7 +2139,12 @@ static void midori_browser_spawn_app (const gchar* uri) { const gchar* executable = sokoke_get_argv (NULL)[0]; - gchar* command = g_strconcat (executable, " -a", NULL); + /* "midori" + "/usr/bin/midori" + "c:/Program Files/Midori/bin/midori.exe" */ + gchar* quoted = g_shell_quote (executable); + gchar* command = g_strconcat (quoted, " -a", NULL); + g_free (quoted); sokoke_spawn_program (command, uri, FALSE); g_free (command); } -- 2.39.5