From ce57c6c72163d069d5b418d64bd0e53445dd8d44 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Wed, 6 Sep 2023 09:31:06 +0200 Subject: [PATCH] xdg-utils: Properly quote flatpak command `xdp_app_info_rewrite_commandline` has to respect `quote_escape` also when no commandline is given. Fixes https://github.com/flatpak/xdg-desktop-portal/issues/1118 --- src/xdp-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xdp-utils.c b/src/xdp-utils.c index 840f71620..b57bfade4 100644 --- a/src/xdp-utils.c +++ b/src/xdp-utils.c @@ -397,8 +397,10 @@ xdp_app_info_rewrite_commandline (XdpAppInfo *app_info, for (i = 1; commandline[i]; i++) g_ptr_array_add (args, maybe_quote (commandline[i], quote_escape)); } - else + else if (quote_escape) g_ptr_array_add (args, g_shell_quote (app_info->id)); + else + g_ptr_array_add (args, g_strdup (app_info->id)); g_ptr_array_add (args, NULL); return (char **)g_ptr_array_free (g_steal_pointer (&args), FALSE);