pinosaur
/
st.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54bc450
)
-e flag handles arguments.
author
Aurélien Aptel
<aurelien.aptel@gmail.com>
Sun, 28 Nov 2010 12:17:20 +0000
(13:17 +0100)
committer
Aurélien Aptel
<aurelien.aptel@gmail.com>
Sun, 28 Nov 2010 12:17:20 +0000
(13:17 +0100)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
4d04416
..
d43c30c
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-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);
}