Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Call _exit() instead of exit() if exec*() fails
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
ad52280
..
4499be6
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-1158,7
+1158,10
@@
execsh(void) {
die("who are you?\n");
}
die("who are you?\n");
}
- sh = (pw->pw_shell[0]) ? pw->pw_shell : shell;
+ if (!(sh = getenv("SHELL"))) {
+ sh = (pw->pw_shell[0]) ? pw->pw_shell : shell;
+ }
+
if(opt_cmd)
prog = opt_cmd[0];
else if(utmp)
if(opt_cmd)
prog = opt_cmd[0];
else if(utmp)
@@
-1187,7
+1190,7
@@
execsh(void) {
signal(SIGALRM, SIG_DFL);
execvp(prog, args);
signal(SIGALRM, SIG_DFL);
execvp(prog, args);
- exit(EXIT_FAILURE);
+
_
exit(EXIT_FAILURE);
}
void
}
void