diff options
| author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-11-28 13:17:20 +0100 |
|---|---|---|
| committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-11-28 13:17:20 +0100 |
| commit | 732b9601ed2543b1fa6acbc08ddc05818279265f (patch) | |
| tree | 26efc54b9d73954244e2e2fc06890b3beb13af12 /st.c | |
| parent | use memmove() instead of memcpy() in ttyread(). (diff) | |
| download | st-732b9601ed2543b1fa6acbc08ddc05818279265f.tar.gz st-732b9601ed2543b1fa6acbc08ddc05818279265f.zip | |
-e flag handles arguments.
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -545,11 +545,15 @@ die(const char *errstr, ...) { | |||
| 545 | 545 | ||
| 546 | void | 546 | void |
| 547 | execsh(void) { | 547 | execsh(void) { |
| 548 | char *args[] = {getenv("SHELL"), "-i", NULL}; | 548 | char **args; |
| 549 | char *envshell = getenv("SHELL"); | ||
| 550 | DEFAULT(envshell, "sh"); | ||
| 551 | |||
| 549 | if(opt_cmd) | 552 | if(opt_cmd) |
| 550 | args[0] = opt_cmd, args[1] = NULL; | 553 | args = (char*[]){"sh", "-c", opt_cmd, NULL}; |
| 551 | else | 554 | else |
| 552 | DEFAULT(args[0], SHELL); | 555 | args = (char*[]){envshell, "-i", NULL}; |
| 556 | |||
| 553 | putenv("TERM="TNAME); | 557 | putenv("TERM="TNAME); |
| 554 | execvp(args[0], args); | 558 | execvp(args[0], args); |
| 555 | } | 559 | } |
