mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* execute.c (shell_execute): Optimize memory usage.
This commit is contained in:
parent
2a80bd15a2
commit
fd1fbef2dd
@ -1,3 +1,7 @@
|
||||
2004-11-26 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* execute.c (shell_execute): Optimize memory usage.
|
||||
|
||||
2004-11-02 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* help.c (help_event): Fix offset of event area for mouse click.
|
||||
|
@ -174,26 +174,25 @@ do_execute (const char *shell, const char *command, int flags)
|
||||
void
|
||||
shell_execute (const char *command, int flags)
|
||||
{
|
||||
char *cmd;
|
||||
char *cmd = NULL;
|
||||
|
||||
if(flags & EXECUTE_HIDE) {
|
||||
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, cmd, flags | EXECUTE_AS_SHELL);
|
||||
do_execute (shell, cmd ? cmd : command, flags | EXECUTE_AS_SHELL);
|
||||
else
|
||||
message (1, MSG_ERROR,
|
||||
_(" The shell is already running a command "));
|
||||
else
|
||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||
do_execute (shell, cmd, flags | EXECUTE_AS_SHELL);
|
||||
do_execute (shell, cmd ? cmd : command, flags | EXECUTE_AS_SHELL);
|
||||
|
||||
g_free(cmd);
|
||||
g_free (cmd);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user