aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-04-12 13:07:19 +0100
committerRon Yorston <rmy@pobox.com>2015-04-12 13:20:38 +0100
commit32f8610c8978673aa5d4f51097f955cdd14c13d8 (patch)
tree86406ab1ea0aa0dd1a1f30c3ac84320831df505a
parentf030c24257d48c71fd11eb2bc4c00224d2970d34 (diff)
downloadbusybox-w32-32f8610c8978673aa5d4f51097f955cdd14c13d8.tar.gz
busybox-w32-32f8610c8978673aa5d4f51097f955cdd14c13d8.tar.bz2
busybox-w32-32f8610c8978673aa5d4f51097f955cdd14c13d8.zip
Allow globbing to be enabled with mingw64
mingw64 handles globbing differently from mingw32. Add code to allow globbing to be enabled. (By default mingw64 has globbing disabled, though the default can be changed when it's compiled.) Also change the configuration option from ENABLE_NOGLOB to ENABLE_GLOBBING, because double negatives make me think too much. The default is still for globbing to be disabled.
-rw-r--r--Config.in17
-rw-r--r--README.md1
-rw-r--r--configs/mingw32_defconfig4
-rw-r--r--win32/mingw.c21
4 files changed, 27 insertions, 16 deletions
diff --git a/Config.in b/Config.in
index c6aad4210..c2ee45dfd 100644
--- a/Config.in
+++ b/Config.in
@@ -630,16 +630,17 @@ config LFS
630 cp, mount, tar, and many others. If you want to access files larger 630 cp, mount, tar, and many others. If you want to access files larger
631 than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'. 631 than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'.
632 632
633config NOGLOB 633config GLOBBING
634 bool "Turn off MSVCRT argument processing" 634 bool "Allow busybox.exe to expand wildcards"
635 default y 635 default n
636 depends on PLATFORM_MINGW32 636 depends on PLATFORM_MINGW32
637 help 637 help
638 The Microsoft C Runtime handles the expansion of wildcards on the 638 In Microsoft Windows expansion of wildcards on the command line
639 command line while the BusyBox shell does its own wildcard expansion. 639 ('globbing') is handled by the C runtime while the BusyBox shell
640 For best results when using the shell MSVCRT globbing should be 640 does its own wildcard expansion. For best results when using the
641 turned off. If you want the BusyBox binary to handle wildcard 641 shell globbing by the C runtime should be turned off. If you want
642 expansion using the Microsoft C Runtime set this to 'N'. 642 the BusyBox binary to handle wildcard expansion using the C runtime
643 set this to 'Y'.
643 644
644config CROSS_COMPILER_PREFIX 645config CROSS_COMPILER_PREFIX
645 string "Cross Compiler prefix" 646 string "Cross Compiler prefix"
diff --git a/README.md b/README.md
index 1ef735a74..ad5b475d3 100644
--- a/README.md
+++ b/README.md
@@ -17,3 +17,4 @@ Then just `make`.
17 - Use forward slashes in paths: Windows doesn't mind and the shell will be happier. 17 - Use forward slashes in paths: Windows doesn't mind and the shell will be happier.
18 - Don't do wild things with Windows drive or UNC notation. 18 - Don't do wild things with Windows drive or UNC notation.
19 - tar doesn't support seamless compression/decompression: use a pipeline to a compressor/decompressor. 19 - tar doesn't support seamless compression/decompression: use a pipeline to a compressor/decompressor.
20 - Wildcard expansion is disabled by default, though it can be turned on at compile time. This only affects command line arguments to the binary: the BusyBox shell has full support for wildcards.
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig
index b42a1a3cc..0608a8692 100644
--- a/configs/mingw32_defconfig
+++ b/configs/mingw32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.24.0.git 3# Busybox version: 1.24.0.git
4# Mon Mar 23 13:58:33 2015 4# Sun Apr 12 13:04:19 2015
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -66,7 +66,7 @@ CONFIG_BUSYBOX_EXEC_PATH=""
66# CONFIG_FEATURE_INDIVIDUAL is not set 66# CONFIG_FEATURE_INDIVIDUAL is not set
67# CONFIG_FEATURE_SHARED_BUSYBOX is not set 67# CONFIG_FEATURE_SHARED_BUSYBOX is not set
68CONFIG_LFS=y 68CONFIG_LFS=y
69CONFIG_NOGLOB=y 69# CONFIG_GLOBBING is not set
70CONFIG_CROSS_COMPILER_PREFIX="i686-w64-mingw32-" 70CONFIG_CROSS_COMPILER_PREFIX="i686-w64-mingw32-"
71CONFIG_SYSROOT="" 71CONFIG_SYSROOT=""
72CONFIG_EXTRA_CFLAGS="" 72CONFIG_EXTRA_CFLAGS=""
diff --git a/win32/mingw.c b/win32/mingw.c
index d76f17820..514d00692 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1,18 +1,27 @@
1#include "libbb.h" 1#include "libbb.h"
2#include <userenv.h> 2#include <userenv.h>
3 3
4#if ENABLE_NOGLOB 4#if defined(__MINGW64_VERSION_MAJOR)
5/* disable MSVCRT command line globbing */ 5#if ENABLE_GLOBBING
6int _CRT_glob = 0; 6int _dowildcard = -1;
7#else
8int _dowildcard = 0;
7#endif 9#endif
8 10
9#if !defined(__MINGW64_VERSION_MAJOR)
10unsigned int _CRT_fmode = _O_BINARY;
11#else
12#undef _fmode 11#undef _fmode
13int _fmode = _O_BINARY; 12int _fmode = _O_BINARY;
14#endif 13#endif
15 14
15#if !defined(__MINGW64_VERSION_MAJOR)
16#if ENABLE_GLOBBING
17int _CRT_glob = 1;
18#else
19int _CRT_glob = 0;
20#endif
21
22unsigned int _CRT_fmode = _O_BINARY;
23#endif
24
16smallint bb_got_signal; 25smallint bb_got_signal;
17 26
18static int err_win_to_posix(DWORD winerr) 27static int err_win_to_posix(DWORD winerr)