[Xfce4-commits] [panel-plugins/xfce4-verve-plugin] 01/01: Use g_shell_quote to fix problems with arguments when using terminal or $SHELL
noreply at xfce.org
noreply at xfce.org
Wed Mar 18 02:55:26 CET 2015
This is an automated email from the git hooks/post-receive script.
isaacschemm pushed a commit to branch master
in repository panel-plugins/xfce4-verve-plugin.
commit 3353ec8a11fe0f122a08c31561ba3c19979786d0
Author: Isaac Schemm <isaacschemm at gmail.com>
Date: Tue Mar 17 20:54:54 2015 -0500
Use g_shell_quote to fix problems with arguments when using terminal or $SHELL
---
panel-plugin/verve.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/panel-plugin/verve.c b/panel-plugin/verve.c
index 7bc60a8..d50539b 100644
--- a/panel-plugin/verve.c
+++ b/panel-plugin/verve.c
@@ -199,20 +199,25 @@ verve_execute (const gchar *input,
/* Find current shell */
char *shell = getenv("SHELL");
if (shell == NULL) shell = "/bin/sh";
-
- /* Run command using the xfterm4 wrapper if the terminal flag was set */
- if (G_UNLIKELY (terminal))
- command = g_strconcat ("exo-open --launch TerminalEmulator '", shell, " -i -c ", input, "'", NULL);
- else
- command = g_strconcat (shell, " -i -c ", input, NULL);
+
+ gchar *quoted_input = g_shell_quote (input);
+ command = g_strconcat (shell, " -i -c ", quoted_input, NULL);
+ g_free (quoted_input);
}
else
{
- /* Run command using the xfterm4 wrapper if the terminal flag was set */
- if (G_UNLIKELY (terminal))
- command = g_strconcat ("exo-open --launch TerminalEmulator '", input, "'", NULL);
- else
- command = g_strdup (input);
+ command = g_strdup (input);
+ }
+
+ /* Run command using the xfterm4 wrapper if the terminal flag was set */
+ if (G_UNLIKELY (terminal))
+ {
+ gchar *quoted_command = g_shell_quote (command);
+
+ g_free (command);
+ command = g_strconcat ("exo-open --launch TerminalEmulator ", quoted_command, NULL);
+
+ g_free (quoted_command);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list