udhcpc: fix a problem with binary-encoded options #2
[oweals/busybox.git] / loginutils / su.c
index 72dd0f06f0b6a59ed1fd2885177aac8c25af4deb..2ec05e12552e04588cc92be1f45d9ef337fd1fb0 100644 (file)
@@ -12,7 +12,6 @@
 //usage:       "[OPTIONS] [-] [USER]"
 //usage:#define su_full_usage "\n\n"
 //usage:       "Run shell under USER (by default, root)\n"
-//usage:     "\nOptions:"
 //usage:     "\n       -,-l    Clear environment, run shell as login shell"
 //usage:     "\n       -p,-m   Do not set new $HOME, $SHELL, $USER, $LOGNAME"
 //usage:     "\n       -c CMD  Command to pass to 'sh -c'"
@@ -132,7 +131,8 @@ int su_main(int argc UNUSED_PARAM, char **argv)
        change_identity(pw);
        setup_environment(opt_shell,
                        ((flags & SU_OPT_l) / SU_OPT_l * SETUP_ENV_CLEARENV)
-                       + (!(flags & SU_OPT_mp) * SETUP_ENV_CHANGEENV),
+                       + (!(flags & SU_OPT_mp) * SETUP_ENV_CHANGEENV)
+                       + (!(flags & SU_OPT_l) * SETUP_ENV_NO_CHDIR),
                        pw);
        IF_SELINUX(set_current_security_context(NULL);)