Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 005aa6e

Browse files
kbleeskasal
authored andcommitted
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 <[email protected]> Signed-off-by: Erik Faye-Lund <[email protected]>
1 parent 5fc41c4 commit 005aa6e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compat/mingw.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,12 @@ pid_t waitpid(pid_t pid, int *status, int options)
18241824
return -1;
18251825
}
18261826

1827+
/*
1828+
* Disable MSVCRT command line wildcard expansion (__getmainargs called from
1829+
* mingw startup code, see init.c in mingw runtime).
1830+
*/
1831+
int _CRT_glob = 0;
1832+
18271833
void mingw_startup()
18281834
{
18291835
/* copy executable name to argv[0] */

0 commit comments

Comments
 (0)