diff options
| author | Eric Pruitt <eric.pruitt@gmail.com> | 2014-10-28 17:51:42 -0700 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2014-11-11 19:20:56 +0100 |
| commit | bafbba56cd5735c680676db2adf6f614ba61356f (patch) | |
| tree | 0c2fb58c68d45c8fab539a4c174f4c9e7809ecd1 | |
| parent | Replace character with U+FFFD if wcwidth() is -1 (diff) | |
| download | st-bafbba56cd5735c680676db2adf6f614ba61356f.tar.gz st-bafbba56cd5735c680676db2adf6f614ba61356f.zip | |
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.
| -rw-r--r-- | st.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -1158,7 +1158,10 @@ execsh(void) { | |||
| 1158 | die("who are you?\n"); | 1158 | die("who are you?\n"); |
| 1159 | } | 1159 | } |
| 1160 | 1160 | ||
| 1161 | sh = (pw->pw_shell[0]) ? pw->pw_shell : shell; | 1161 | if (!(sh = getenv("SHELL"))) { |
| 1162 | sh = (pw->pw_shell[0]) ? pw->pw_shell : shell; | ||
| 1163 | } | ||
| 1164 | |||
| 1162 | if(opt_cmd) | 1165 | if(opt_cmd) |
| 1163 | prog = opt_cmd[0]; | 1166 | prog = opt_cmd[0]; |
| 1164 | else if(utmp) | 1167 | else if(utmp) |
