aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-07-08 14:10:31 +0100
committerRon Yorston <rmy@pobox.com>2024-07-08 14:10:31 +0100
commitfff1c91e642f4d62e5dc542594e79b0972a3db78 (patch)
tree549230ec628e19105fc814ab8746264d96c0d9ea /shell
parent9e0db7ef4a231cdf619e3fb7223ad1345b2adcf0 (diff)
downloadbusybox-w32-fff1c91e642f4d62e5dc542594e79b0972a3db78.tar.gz
busybox-w32-fff1c91e642f4d62e5dc542594e79b0972a3db78.tar.bz2
busybox-w32-fff1c91e642f4d62e5dc542594e79b0972a3db78.zip
ash: read profile script relative to binary
As well as trying to read '/etc/profile' also look for the script 'etc/profile' relative to the location of the running binary. Adds 64-96 bytes.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 881bc12ab..d9ab3feb5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -16295,6 +16295,10 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
16295 hp = concat_path_file(get_system_drive(), "/etc/profile"); 16295 hp = concat_path_file(get_system_drive(), "/etc/profile");
16296 read_profile(hp); 16296 read_profile(hp);
16297 free((void *)hp); 16297 free((void *)hp);
16298
16299 hp = exe_relative_path("/etc/profile");
16300 read_profile(hp);
16301 free((void *)hp);
16298#else 16302#else
16299 read_profile("/etc/profile"); 16303 read_profile("/etc/profile");
16300#endif 16304#endif