diff --git a/term.c b/term.c index ec4b2aa..2c7c06e 100644 --- a/term.c +++ b/term.c @@ -7,7 +7,6 @@ #endif #include #include -#include #include // compile with gcc term.c -lutil @@ -31,10 +30,6 @@ int main(int argc, char **argv) { shell = "/bin/sh"; } - // find the shell's name - char *slash = strrchr(shell, '/'); - char *name = slash == NULL ? shell : slash + 1; - // allocate a pty, fork, inititialize file descriptor int fdm = -1; // allocate file descriptor pid_t pid = forkpty(&fdm, NULL, NULL, NULL); @@ -46,9 +41,9 @@ int main(int argc, char **argv) { setenv("TERM", "ansi", 1); // execute shell if (login) { - execlp(name, shell, "-l", "-i", NULL); + execlp(shell, shell, "-l", "-i", NULL); } else { - execlp(name, shell, NULL); + execlp(shell, shell, NULL); } perror("exec bash failed"); } else { // parent