From 494dc899fd1b3b5fbac1c47bc5a604aed99654c8 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 10 Dec 2012 13:52:11 +0000 Subject: Add a build option to turn MSVCRT globbing on or off --- Config.in | 11 +++++++++++ applets/applets.c | 2 +- configs/mingw32_defconfig | 3 ++- libbb/appletlib.c | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Config.in b/Config.in index cd51e2b45..def0c2c32 100644 --- a/Config.in +++ b/Config.in @@ -610,6 +610,17 @@ config LFS cp, mount, tar, and many others. If you want to access files larger than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'. +config NOGLOB + bool "Turn off MSVCRT argument processing" + default y + depends on PLATFORM_MINGW32 + help + The Microsoft C Runtime handles the expansion of wildcards on the + command line while the BusyBox shell does its own wildcard expansion. + For best results when using the shell MSVCRT globbing should be + turned off. If you want the BusyBox binary to handle wildcard + expansion using the Microsoft C Runtime set this to 'N'. + config CROSS_COMPILER_PREFIX string "Cross Compiler prefix" default "" diff --git a/applets/applets.c b/applets/applets.c index 7ffa7a896..0e2f94f40 100644 --- a/applets/applets.c +++ b/applets/applets.c @@ -9,7 +9,7 @@ #include "busybox.h" #if ENABLE_BUILD_LIBBUSYBOX -#if ENABLE_PLATFORM_MINGW32 +#if ENABLE_NOGLOB /* disable MSVCRT command line globbing */ int _CRT_glob = 0; #endif diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig index 7ed14c40b..b7e7594c5 100644 --- a/configs/mingw32_defconfig +++ b/configs/mingw32_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.21.0.git -# Thu Nov 29 10:22:19 2012 +# Mon Dec 10 13:44:07 2012 # CONFIG_HAVE_DOT_CONFIG=y # CONFIG_PLATFORM_POSIX is not set @@ -64,6 +64,7 @@ CONFIG_BUSYBOX_EXEC_PATH="" # CONFIG_FEATURE_INDIVIDUAL is not set # CONFIG_FEATURE_SHARED_BUSYBOX is not set # CONFIG_LFS is not set +CONFIG_NOGLOB=y CONFIG_CROSS_COMPILER_PREFIX="i686-pc-mingw32-" CONFIG_SYSROOT="" CONFIG_EXTRA_CFLAGS="-g -O0" diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 9f3584755..63ec010dd 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -773,7 +773,7 @@ void FAST_FUNC run_applet_and_exit(const char *name, char **argv) #if ENABLE_BUILD_LIBBUSYBOX int lbb_main(char **argv) #else -#if ENABLE_PLATFORM_MINGW32 +#if ENABLE_NOGLOB /* disable MSVCRT command line globbing */ int _CRT_glob = 0; #endif -- cgit v1.2.3-55-g6feb