From ba0c44bcd69fbb15186caf443fc828e925eaeec9 Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Fri, 7 Jan 2011 19:52:20 +0100 Subject: [PATCH] MinGW: disable CRT command line globbing MingwRT listens to _CRT_glob to decide if __getmainargs should perform globbing, with the default being that it should. Unfortunately, __getmainargs globbing is sub-par; for instance patterns like "*.c" will only match c-sources in the current directory. Disable __getmainargs' command line wildcard expansion, so these patterns will be left untouched, and handled by Git's superior built-in globbing instead. MSVC defaults to no globbing, so we don't need to do anything in that case. This fixes t5505 and t7810. Signed-off-by: Karsten Blees Signed-off-by: Erik Faye-Lund --- compat/mingw.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compat/mingw.c b/compat/mingw.c index b88956a758..df7184d5e0 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1824,6 +1824,12 @@ pid_t waitpid(pid_t pid, int *status, int options) return -1; } +/* + * Disable MSVCRT command line wildcard expansion (__getmainargs called from + * mingw startup code, see init.c in mingw runtime). + */ +int _CRT_glob = 0; + void mingw_startup() { /* copy executable name to argv[0] */ -- 2.11.4.GIT