diff --git a/src/ChangeLog b/src/ChangeLog index f32df9051..50742d177 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2004-11-18 Pavel Shirshov + + * user.c (execute_menu_command): Revert last changes. Execute + shell_execute() with flag EXECUTE_HIDE to prevent recording + in ~/.bash_history. + * execute.h: Add EXECUTE_HIDE flag. It's used to prefix the command + with a space. + * execute.c (shell_execute): Prefix the command with a space, if define + EXECUTE_HIDE flag. + 2004-11-17 Roland Illig * screen.c (do_search): Ignore the backspace key on empty diff --git a/src/execute.c b/src/execute.c index eb710a9ad..2dd7486b8 100644 --- a/src/execute.c +++ b/src/execute.c @@ -174,16 +174,26 @@ do_execute (const char *shell, const char *command, int flags) void shell_execute (const char *command, int flags) { + char *cmd; + + if(flags & EXECUTE_HIDE) { + cmd = g_strconcat (" ", command, (char *) NULL); + flags ^= EXECUTE_HIDE; + } else + cmd = g_strdup(command); + #ifdef HAVE_SUBSHELL_SUPPORT if (use_subshell) if (subshell_state == INACTIVE) - do_execute (shell, command, flags | EXECUTE_AS_SHELL); + do_execute (shell, cmd, flags | EXECUTE_AS_SHELL); else message (1, MSG_ERROR, _(" The shell is already running a command ")); else #endif /* HAVE_SUBSHELL_SUPPORT */ - do_execute (shell, command, flags | EXECUTE_AS_SHELL); + do_execute (shell, cmd, flags | EXECUTE_AS_SHELL); + + g_free(cmd); } diff --git a/src/execute.h b/src/execute.h index 52261da78..19b7b5aec 100644 --- a/src/execute.h +++ b/src/execute.h @@ -3,6 +3,7 @@ #define EXECUTE_INTERNAL 1 #define EXECUTE_AS_SHELL 4 +#define EXECUTE_HIDE 8 /* Execute functions that use the shell to execute */ void shell_execute (const char *command, int flags); diff --git a/src/user.c b/src/user.c index 8daa896f4..b65ae5518 100644 --- a/src/user.c +++ b/src/user.c @@ -546,7 +546,7 @@ execute_menu_command (WEdit *edit_widget, const char *commands) int do_quote = 0; char prompt [80]; int col; - char *file_name, *space_file_name; + char *file_name; int run_view = 0; /* Skip menu entry title line */ @@ -632,16 +632,14 @@ execute_menu_command (WEdit *edit_widget, const char *commands) } fclose (cmd_file); chmod (file_name, S_IRWXU); - space_file_name = g_strconcat (" ", file_name, (char *) NULL); if (run_view) { run_view = 0; - view (space_file_name, 0, &run_view, 0); + view (file_name, 0, &run_view, 0); } else { - shell_execute (space_file_name, 0); + shell_execute (file_name, EXECUTE_HIDE); } unlink (file_name); g_free (file_name); - g_free (space_file_name); } /*