[Xfce4-commits] <xfce-utils:master> Save the command the user typed, not the expanded one.

Jérôme Guelfucci noreply at xfce.org
Mon Oct 25 14:46:06 CEST 2010


Updating branch refs/heads/master
         to 8b8f55002b791f7f0b58dcb1f0dde076846ce485 (commit)
       from 58b4d3f21d704815ed5a6cef3cb31548f44c3931 (commit)

commit 8b8f55002b791f7f0b58dcb1f0dde076846ce485
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Mon Oct 25 13:53:32 2010 +0200

    Save the command the user typed, not the expanded one.

 xfrun/xfrun-dialog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xfrun/xfrun-dialog.c b/xfrun/xfrun-dialog.c
index 391f8e8..2b89c72 100644
--- a/xfrun/xfrun-dialog.c
+++ b/xfrun/xfrun-dialog.c
@@ -502,10 +502,12 @@ xfrun_run_clicked(GtkWidget *widget,
     GError       *error = NULL;
     gchar       **argv = NULL;
     gchar        *cmdline;
+    gchar        *original_cmdline;
     gchar        *new_cmdline;
     gint          argc;
 
     cmdline = gtk_editable_get_chars(GTK_EDITABLE(dialog->priv->entry), 0, -1);
+    original_cmdline = g_strdup (cmdline);
     in_terminal = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->priv->terminal_chk));
 
     new_cmdline = xfce_expand_variables (cmdline, NULL);
@@ -555,7 +557,7 @@ xfrun_run_clicked(GtkWidget *widget,
                                    xfrun_spawn_child_setup, NULL, NULL,
                                    &error))
     {
-        xfrun_add_to_history(cmdline, in_terminal);
+        xfrun_add_to_history(original_cmdline, in_terminal);
         xfrun_dialog_delete_event(GTK_WIDGET(dialog), NULL);
     } else {
         gchar *primary = g_strdup_printf(_("The command \"%s\" failed to run:"),
@@ -570,6 +572,7 @@ xfrun_run_clicked(GtkWidget *widget,
     }
 
     g_free(cmdline);
+    g_free(original_cmdline);
     if(in_terminal)
         g_free(argv);
     else



More information about the Xfce4-commits mailing list