diff options
Diffstat (limited to 'libbb/setup_environment.c')
-rw-r--r-- | libbb/setup_environment.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index a95fbc5bf..73229ca6c 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c | |||
@@ -32,6 +32,9 @@ | |||
32 | 32 | ||
33 | void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw) | 33 | void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw) |
34 | { | 34 | { |
35 | if (!shell || !shell[0]) | ||
36 | shell = DEFAULT_SHELL; | ||
37 | |||
35 | /* Change the current working directory to be the home directory | 38 | /* Change the current working directory to be the home directory |
36 | * of the user */ | 39 | * of the user */ |
37 | if (chdir(pw->pw_dir)) { | 40 | if (chdir(pw->pw_dir)) { |