summaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2006-10-05 21:05:12 +0000
committerRich Felker <dalias@aerifal.cx>2006-10-05 21:05:12 +0000
commitdc6a00a52f6df3c7e66c6535c2489f51fa1fa13a (patch)
tree63a501e515b3579fee35748a08294b94c56f10e5 /tty.c
parent98f8b3709355fd0f3e05952cee3ec54ec2d0b5ba (diff)
downloaduuterm-dc6a00a52f6df3c7e66c6535c2489f51fa1fa13a.tar.gz
use $SHELL
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tty.c b/tty.c
index 8a2ccda..a430f0f 100644
--- a/tty.c
+++ b/tty.c
@@ -50,7 +50,11 @@ int uutty_open(char **cmd, int w, int h)
if (pts > 2) close(pts);
// FIXME............................
if (cmd) execvp(cmd[0], cmd);
- else execl("/bin/sh", "-sh", (char *)0);
+ else {
+ char *s = getenv("SHELL");
+ if (!s) s = "/bin/sh";
+ execl(s, s, (char *)0);
+ }
return 1;
}