mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-21 23:05:59 +01:00
Check for presence of SHELL environment variable
- POSIX states the SHELL environment variable "... shall represent a pathname of the user's preferred command language interpreter." As such, st should check for its presence when deciding what shell to use; just as HOME can be defined to override one's passwd-defined home directory, a user should also be able to override their passwd-defined shell using the SHELL environment variable.
This commit is contained in:
parent
11625c7166
commit
bafbba56cd
1 changed files with 4 additions and 1 deletions
5
st.c
5
st.c
|
@ -1158,7 +1158,10 @@ execsh(void) {
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue