diff options
author | Ron Yorston <rmy@pobox.com> | 2020-06-14 10:17:04 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-06-14 10:17:04 +0100 |
commit | f41697493de1a25d0f56930d81cf9560172ce7b7 (patch) | |
tree | 998b60552725808730478c3288f2452a40ffe7b8 /libbb/appletlib.c | |
parent | b1a5034ca852efe2c24212db77d7b0b2660a687b (diff) | |
download | busybox-w32-f41697493de1a25d0f56930d81cf9560172ce7b7.tar.gz busybox-w32-f41697493de1a25d0f56930d81cf9560172ce7b7.tar.bz2 busybox-w32-f41697493de1a25d0f56930d81cf9560172ce7b7.zip |
win32: enable globbing by default
Change how busybox.exe expands wildcards on the command line.
When globbing is enabled at compile time provide an implementation
of _setargv(), which is run early during startup of C programs. This:
- enables globbing by setting _dowildcard to -1
- checks for the presence of the environment BB_GLOBBING
- if it exists and is set to 0 disables globbing
- if it doesn't exist sets BB_GLOBBING=0 but continues to apply
Windows' globbing in the current process
The consequences of this are:
- When busybox.exe is initially run from a Command Prompt Windows'
globbing is applied;
- Windows' globbing is turned off for future child processes, thus
allowing the shell re-execute busybox.exe without it interfering
with wildcards;
- this behaviour can be overridden by setting BB_GLOBBING explicitly.
Globbing can still be disabled at compile time if required. In that
case BB_GLOBBING has no effect.
With these changes globbing can be enabled by default and BusyBox
will do the right thing in most circumstances.
(See GitHub issues #172 and #189.)
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 9caa04ac3..8c46d0d1b 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -915,11 +915,6 @@ int busybox_main(int argc UNUSED_PARAM, char **argv) | |||
915 | "\tTo run external program, use full path (/sbin/ip instead of ip).\n" | 915 | "\tTo run external program, use full path (/sbin/ip instead of ip).\n" |
916 | ) | 916 | ) |
917 | "\n" | 917 | "\n" |
918 | #if ENABLE_GLOBBING | ||
919 | "\tSupport for native Windows wildcards is enabled. In some\n" | ||
920 | "\tcases this may result in wildcards being processed twice.\n" | ||
921 | "\n" | ||
922 | #endif | ||
923 | "Currently defined functions:\n" | 918 | "Currently defined functions:\n" |
924 | ); | 919 | ); |
925 | col = 0; | 920 | col = 0; |