commit - 0f3765593981821986c7586350d792e26c22f71e
commit + 191e59e4389cc0d235c14be5a53554267a81c0a6
blob - 4d04416d1946b02bdb277585d030bb9c9c3f0991
blob + d43c30c805538b763041ac7b1c1701297e0af13c
--- st.c
+++ st.c
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);
}