* execute.c (shell_execute): Optimize memory usage.

This commit is contained in:
Andrew V. Samoilov 2004-11-26 11:14:07 +00:00
parent 2a80bd15a2
commit fd1fbef2dd
2 changed files with 10 additions and 7 deletions

View File

@ -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.

View File

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