aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 0b41e7931..3bbfbd694 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -14584,10 +14584,13 @@ init(void)
14584 } 14584 }
14585 } 14585 }
14586 14586
14587 /* some initialisation normally performed at login */ 14587 /* Initialise some variables normally set at login, but
14588 * only if someone hasn't already set them. */
14588 pw = xgetpwuid(getuid()); 14589 pw = xgetpwuid(getuid());
14589 setup_environment(pw->pw_shell, 14590 if (!getenv("USER")) xsetenv("USER", pw->pw_name);
14590 SETUP_ENV_CHANGEENV|SETUP_ENV_NO_CHDIR, pw); 14591 if (!getenv("LOGNAME")) xsetenv("LOGNAME", pw->pw_name);
14592 if (!getenv("HOME")) xsetenv("HOME", pw->pw_dir);
14593 if (!getenv("SHELL")) xsetenv("SHELL", DEFAULT_SHELL);
14591 } 14594 }
14592#endif 14595#endif
14593 for (envp = environ; envp && *envp; envp++) { 14596 for (envp = environ; envp && *envp; envp++) {