diff options
author | Ron Yorston <rmy@pobox.com> | 2023-06-04 08:00:51 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-06-04 08:00:51 +0100 |
commit | bd7018350d7e816a90dde97fa0a4abf41be17b4d (patch) | |
tree | f28f42c8139dd1b9aae339ef0c9b69356c6c9acc /include | |
parent | e013876e1dc0ce8e3a36abea9390d35a7053bd84 (diff) | |
download | busybox-w32-bd7018350d7e816a90dde97fa0a4abf41be17b4d.tar.gz busybox-w32-bd7018350d7e816a90dde97fa0a4abf41be17b4d.tar.bz2 busybox-w32-bd7018350d7e816a90dde97fa0a4abf41be17b4d.zip |
win32: another BB_OVERRIDE_APPLETS fix
Support for conditionally replacing applets with external commands
requires the ability to check whether a given command name is
present on PATH. This was being done using the PATH environment
variable, which works in commands run by the shell but not in the
shell itself.
- The shell uses the *shell* variable PATH to look for executables.
This may not be the same as the *environment* variable.
- 'command -p' uses an entirely different PATH.
Applet look-up in the shell is now treated as a special case, with
the actual PATH being used passed to the look-up code in a global
variable.
This doesn't affect tab completion in the shell: whether a
completion is an applet or an external command is irrelevant.
Costs 152-288 bytes.
(GitHub issue #329)
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index a4eebab99..1200e636a 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1330,6 +1330,9 @@ int find_preferred_applet_by_name(const char *name) FAST_FUNC; | |||
1330 | int is_applet_preferred(const char *name) FAST_FUNC; | 1330 | int is_applet_preferred(const char *name) FAST_FUNC; |
1331 | # if ENABLE_PLATFORM_MINGW32 && \ | 1331 | # if ENABLE_PLATFORM_MINGW32 && \ |
1332 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) | 1332 | (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) |
1333 | # if ENABLE_ASH | ||
1334 | extern const char *ash_path; | ||
1335 | # endif | ||
1333 | # define find_applet_by_name(n) find_preferred_applet_by_name(n) | 1336 | # define find_applet_by_name(n) find_preferred_applet_by_name(n) |
1334 | # else | 1337 | # else |
1335 | # define is_applet_preferred(n) (1) | 1338 | # define is_applet_preferred(n) (1) |