From fcddf9c2a1e0c76843af91d6d530194bcb7d8791 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 8 Jul 2010 14:58:33 -0400 Subject: [PATCH] Escape arguments when putting together a cmdline See bug 623770 --- gio/gdesktopappinfo.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 660068416..ea2d403a0 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -698,18 +698,28 @@ expand_macro (char macro, if (info->icon_name) { g_string_append (exec, "--icon "); - g_string_append (exec, info->icon_name); + expanded = g_shell_quote (info->icon_name); + g_string_append (exec, expanded); + g_free (expanded); } break; case 'c': if (info->name) - g_string_append (exec, info->name); + { + expanded = g_shell_quote (info->name); + g_string_append (exec, expanded); + g_free (expanded); + } break; case 'k': if (info->filename) - g_string_append (exec, info->filename); + { + expanded = g_shell_quote (info->filename); + g_string_append (exec, info->filename); + g_free (expanded); + } break; case 'm': /* deprecated */