diff options
author | Ron Yorston <rmy@pobox.com> | 2024-07-08 14:10:31 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-07-08 14:10:31 +0100 |
commit | fff1c91e642f4d62e5dc542594e79b0972a3db78 (patch) | |
tree | 549230ec628e19105fc814ab8746264d96c0d9ea /win32 | |
parent | 9e0db7ef4a231cdf619e3fb7223ad1345b2adcf0 (diff) | |
download | busybox-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 'win32')
-rw-r--r-- | win32/mingw.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 273b8d840..f2b025e43 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -2507,3 +2507,11 @@ change_critical_error_dialogs(const char *newval) | |||
2507 | SetErrorMode(newval && newval[0] == '1' && newval[1] == '\0' ? | 2507 | SetErrorMode(newval && newval[0] == '1' && newval[1] == '\0' ? |
2508 | 0 : SEM_FAILCRITICALERRORS); | 2508 | 0 : SEM_FAILCRITICALERRORS); |
2509 | } | 2509 | } |
2510 | |||
2511 | char *exe_relative_path(const char *tail) | ||
2512 | { | ||
2513 | char *exepath = xstrdup(bb_busybox_exec_path); | ||
2514 | char *relpath = concat_path_file(dirname(exepath), tail); | ||
2515 | free(exepath); | ||
2516 | return relpath; | ||
2517 | } | ||