summaryrefslogtreecommitdiff
path: root/coreutils/chroot.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/chroot.c')
-rw-r--r--coreutils/chroot.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index fcd70f2..874ee91 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -27,8 +27,9 @@ int chroot_main(int argc, char **argv)
++argv;
if (argc == 2) {
argv -= 2;
- if (!(*argv = getenv("SHELL"))) {
- *argv = (char *) DEFAULT_SHELL;
+ argv[0] = getenv("SHELL");
+ if (!argv[0]) {
+ argv[0] = (char *) DEFAULT_SHELL;
}
argv[1] = (char *) "-i";
}