[gnome-commander] Inserted quotes in the command for opening root terminal



commit 47feaad9e1310b9ef2063ebe66719bf4039d0167
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Wed Jan 22 09:57:47 2014 +0100

    Inserted quotes in the command for opening root terminal

 src/gnome-cmd-user-actions.cc |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index cab7ce0..b257147 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -1225,6 +1225,16 @@ void command_open_terminal_as_root (GtkMenuItem *menuitem, gpointer not_used)
 
     gnome_prepend_terminal_to_vector (&argc, &argv);
 
+    // insert quotes into the string to get
+    // /usr/bin/gksu 'roxterm -e /bin/bash' instead of
+    // /usr/bin/gksu roxterm -e /bin/bash
+    // for example (the first case doesn't work)
+    gchar *cmd = g_strjoinv (" ", argv);
+    g_strfreev (argv);
+    argc = 1;
+    argv = g_new0 (char *, argc+1);
+    argv[0] = cmd;
+
     if (gnome_cmd_prepend_su_to_vector (argc, argv))
     {
         gchar *dpath = GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory())->get_real_path();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]