aboutsummaryrefslogtreecommitdiff
path: root/miscutils/man.c
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 /miscutils/man.c
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 'miscutils/man.c')
-rw-r--r--miscutils/man.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/miscutils/man.c b/miscutils/man.c
index c3efe4484..3954455b4 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
@@ -261,7 +261,7 @@ int man_main(int argc UNUSED_PARAM, char **argv)
261 char *token[2]; 261 char *token[2];
262#if ENABLE_PLATFORM_MINGW32 262#if ENABLE_PLATFORM_MINGW32
263 char **ptr; 263 char **ptr;
264 char *exepath, *relpath; 264 char *relpath;
265 const char *mpl[] = { "/usr/man", "/usr/share/man", NULL, NULL }; 265 const char *mpl[] = { "/usr/man", "/usr/share/man", NULL, NULL };
266#endif 266#endif
267 267
@@ -316,8 +316,7 @@ int man_main(int argc UNUSED_PARAM, char **argv)
316 316
317#if ENABLE_PLATFORM_MINGW32 317#if ENABLE_PLATFORM_MINGW32
318 /* allow man pages to be stored relative to the executable */ 318 /* allow man pages to be stored relative to the executable */
319 exepath = xstrdup(bb_busybox_exec_path); 319 relpath = exe_relative_path("man");
320 relpath = concat_path_file(dirname(exepath), "man");
321 320
322 if (!man_path_list) { 321 if (!man_path_list) {
323 mpl[2] = relpath; 322 mpl[2] = relpath;