cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-11-29 05:48:06 +00:00
parent 2e2112cad1
commit eae8571ae4
1 changed files with 7 additions and 8 deletions

View File

@ -258,6 +258,7 @@ bool execute_command(const char *command)
{ {
int fd[2]; int fd[2];
FILE *f; FILE *f;
char *shellenv;
struct sigaction oldaction, newaction; struct sigaction oldaction, newaction;
/* Original and temporary handlers for SIGINT. */ /* Original and temporary handlers for SIGINT. */
bool sig_failed = FALSE; bool sig_failed = FALSE;
@ -269,20 +270,18 @@ bool execute_command(const char *command)
return FALSE; return FALSE;
} }
/* Check $SHELL for the shell to use. If it isn't set, use
* /bin/sh. */
shellenv = getenv("SHELL");
if (shellenv == NULL)
shellenv = "/bin/sh";
/* Fork a child. */ /* Fork a child. */
if ((pid = fork()) == 0) { if ((pid = fork()) == 0) {
char *shellenv;
close(fd[0]); close(fd[0]);
dup2(fd[1], fileno(stdout)); dup2(fd[1], fileno(stdout));
dup2(fd[1], fileno(stderr)); dup2(fd[1], fileno(stderr));
/* Check $SHELL for the shell to use. If it isn't set, use
* /bin/sh. */
shellenv = getenv("SHELL");
if (shellenv == NULL)
shellenv = "/bin/sh";
/* If execl() returns at all, there was an error. */ /* If execl() returns at all, there was an error. */
execl(shellenv, tail(shellenv), "-c", command, NULL); execl(shellenv, tail(shellenv), "-c", command, NULL);
exit(0); exit(0);