]> git.ipfire.org Git - thirdparty/git.git/commitdiff
MinGW: disable CRT command line globbing
authorKarsten Blees <blees@dcon.de>
Fri, 7 Jan 2011 18:52:20 +0000 (19:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jun 2014 17:56:47 +0000 (10:56 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c

index 6849815b39a9a4716e1247178036621b18d1fdca..1140a131bfa4e1cc004cef162ad749df985ca0d9 100644 (file)
@@ -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] */