* 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.
This commit is contained in:
Andrew V. Samoilov 2004-11-18 17:47:55 +00:00
parent 82f580f857
commit 17ec1c5476
4 changed files with 26 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2004-11-18 Pavel Shirshov <me@pavelsh.pp.ru>
* 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 <roland.illig@gmx.de>
* screen.c (do_search): Ignore the backspace key on empty

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}
/*