diff options
author | Ron Yorston <rmy@pobox.com> | 2023-10-06 11:30:21 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-10-06 11:30:21 +0100 |
commit | 9a4fe0bc63f2e98bac0e647e12620929d8658e50 (patch) | |
tree | 167153bad0c6f964d306f4e1440f05bafbb1dc18 | |
parent | 199687610d3bf1b29b7342da40d9306dd46accdc (diff) | |
download | busybox-w32-9a4fe0bc63f2e98bac0e647e12620929d8658e50.tar.gz busybox-w32-9a4fe0bc63f2e98bac0e647e12620929d8658e50.tar.bz2 busybox-w32-9a4fe0bc63f2e98bac0e647e12620929d8658e50.zip |
make: permit Unix-style paths when setting MAKE
The 'make' applet follows POSIX requirements when setting the MAKE
variable. However, it doesn't allow for the case where argv[0] is
of a form like '/bin/make' but no corresponding executable exists.
This can happen in busybox-w32 when '/bin/make' is interpreted as
a reference to the 'make' applet.
In this case set the MAKE variable to argv[0] and avoid issuing a
warning.
Setting MAKE to something that isn't a real executable is fine so
long as it's only used by busybox-w32 applets. If it's used by
external applications they may get confused.
Adds 16-32 bytes.
(GitHub issue #354)
-rw-r--r-- | miscutils/make.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 8feec1202..b6103bb58 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
@@ -2820,7 +2820,10 @@ int make_main(int argc UNUSED_PARAM, char **argv) | |||
2820 | path = newpath = xmalloc_realpath(p); | 2820 | path = newpath = xmalloc_realpath(p); |
2821 | free(p); | 2821 | free(p); |
2822 | if (!path) { | 2822 | if (!path) { |
2823 | bb_perror_msg("can't resolve path for %s", argv[0]); | 2823 | if (unix_path(argv[0])) |
2824 | path = argv[0]; | ||
2825 | else | ||
2826 | bb_perror_msg("can't resolve path for %s", argv[0]); | ||
2824 | } | 2827 | } |
2825 | } | 2828 | } |
2826 | #else | 2829 | #else |