diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 08:52:02 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 08:52:02 +0000 |
commit | 15611bb95815de14bcb35f66bd10089a322ea30b (patch) | |
tree | 818f4e4a208cc04e37f2ea12fd4bda4eae30dd4c /libbb/setup_environment.c | |
parent | 16d58d75ee11f3b50550fbef7da12a4adbab66d4 (diff) | |
download | busybox-w32-15611bb95815de14bcb35f66bd10089a322ea30b.tar.gz busybox-w32-15611bb95815de14bcb35f66bd10089a322ea30b.tar.bz2 busybox-w32-15611bb95815de14bcb35f66bd10089a322ea30b.zip |
A few more string duplicates found & eliminated
# size busybox_old busybox_unstripped
text data bss dec hex filename
679693 2700 15632 698025 aa6a9 busybox_old
679523 2700 15632 697855 aa5ff busybox_unstripped
Diffstat (limited to 'libbb/setup_environment.c')
-rw-r--r-- | libbb/setup_environment.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index 18d5a0610..a98b9a5bd 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c | |||
@@ -30,11 +30,6 @@ | |||
30 | 30 | ||
31 | #include "libbb.h" | 31 | #include "libbb.h" |
32 | 32 | ||
33 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | ||
34 | * but I want to save a few bytes here */ | ||
35 | static const char DEFAULT_ROOT_LOGIN_PATH[] = "/sbin:/usr/sbin:/bin:/usr/bin"; | ||
36 | #define DEFAULT_LOGIN_PATH (DEFAULT_ROOT_LOGIN_PATH + sizeof("/sbin:/usr/sbin")) | ||
37 | |||
38 | void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw) | 33 | void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw) |
39 | { | 34 | { |
40 | if (loginshell) { | 35 | if (loginshell) { |
@@ -61,7 +56,7 @@ void setup_environment(const char *shell, int loginshell, int changeenv, const s | |||
61 | xsetenv("SHELL", shell); | 56 | xsetenv("SHELL", shell); |
62 | xsetenv("USER", pw->pw_name); | 57 | xsetenv("USER", pw->pw_name); |
63 | xsetenv("LOGNAME", pw->pw_name); | 58 | xsetenv("LOGNAME", pw->pw_name); |
64 | xsetenv("PATH", (pw->pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH)); | 59 | xsetenv("PATH", (pw->pw_uid ? bb_default_login_path : bb_default_root_login_path)); |
65 | } | 60 | } |
66 | else if (changeenv) { | 61 | else if (changeenv) { |
67 | /* Set HOME, SHELL, and if not becoming a super-user, | 62 | /* Set HOME, SHELL, and if not becoming a super-user, |