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 | 191e59e4389cc0d235c14be5a53554267a81c0a6 (patch) | |
tree | 26efc54b9d73954244e2e2fc06890b3beb13af12 /st.c | |
parent | 0f3765593981821986c7586350d792e26c22f71e (diff) | |
download | st-191e59e4389cc0d235c14be5a53554267a81c0a6.tar.gz st-191e59e4389cc0d235c14be5a53554267a81c0a6.tar.bz2 |
-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, ...) { void execsh(void) { - char *args[] = {getenv("SHELL"), "-i", NULL}; + char **args; + char *envshell = getenv("SHELL"); + DEFAULT(envshell, "sh"); + if(opt_cmd) - args[0] = opt_cmd, args[1] = NULL; + args = (char*[]){"sh", "-c", opt_cmd, NULL}; else - DEFAULT(args[0], SHELL); + args = (char*[]){envshell, "-i", NULL}; + putenv("TERM="TNAME); execvp(args[0], args); } |