[PATCH 4/7] MinGW: disable CRT command line globbing
- From
Stepan Kasal <kasal@ucw.cz>
- Date
- Jun 11, 2014, 09:37 UTC
- Message-ID
- <1402479466-8500-5-git-send-email-kasal@ucw.cz>
- In-Reply-To
- <1402479466-8500-1-git-send-email-kasal@ucw.cz>
From: Karsten Blees <blees@dcon.de> Date: Fri, 7 Jan 2011 19:52:20 +0100
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 <blees@dcon.de> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Stepan Kasal <kasal@ucw.cz> --- compat/mingw.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/compat/mingw.c b/compat/mingw.c index 6849815..1140a13 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1927,6 +1927,12 @@ int xwcstoutf(char *utf, const wchar_t *wcs, size_t utflen) 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.0.0.9635.g0be03cb -- -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en --- You received this message because you are subscribed to the Google Groups "msysGit" group. To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.