diff options
| -rwxr-xr-x | st.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -208,12 +208,10 @@ die(const char *errstr, ...) { | |||
| 208 | 208 | ||
| 209 | void | 209 | void |
| 210 | execsh(void) { | 210 | execsh(void) { |
| 211 | char *shell = getenv("SHELL"); | 211 | char *args[3] = {getenv("SHELL"), "-i", NULL}; |
| 212 | if(!shell) | 212 | DEFAULT(args[0], "/bin/sh"); /* default shell if getenv() failed */ |
| 213 | shell = "/bin/sh"; | ||
| 214 | char *args[3] = {shell, "-i", NULL}; | ||
| 215 | putenv("TERM=" TNAME); | 213 | putenv("TERM=" TNAME); |
| 216 | execvp(shell, args); | 214 | execvp(args[0], args); |
| 217 | } | 215 | } |
| 218 | 216 | ||
| 219 | void | 217 | void |
