summaryrefslogtreecommitdiff
path: root/coreutils/chroot.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/chroot.c')
-rw-r--r--coreutils/chroot.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index b80a12e..5ac2e89 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -23,11 +23,9 @@ int chroot_main(int argc UNUSED_PARAM, char **argv)
++argv;
if (!*argv) { /* no 2nd param (PROG), use shell */
argv -= 2;
- argv[0] = getenv("SHELL");
- if (!argv[0]) {
- argv[0] = (char *) DEFAULT_SHELL;
- }
- argv[1] = (char *) "-i";
+ argv[0] = (char *) get_shell_name();
+ argv[1] = (char *) "-i"; /* GNU coreutils 8.4 compat */
+ /*argv[2] = NULL; - already is */
}
BB_EXECVP_or_die(argv);