]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_main: turn off MinGW CRT's globbing
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 21 Aug 2017 19:35:46 +0000 (21:35 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Tue, 22 Aug 2017 07:21:23 +0000 (09:21 +0200)
By default, the MinGW CRT globs command-line arguments. This prevents
getting a single asterisk into an argument as test 1299 does. Turn off
globbing by setting the global variable _CRT_glob to 0 for MinGW.

Fixes https://github.com/curl/curl/issues/1751
Closes https://github.com/curl/curl/pull/1813

src/tool_main.c

index 089a317d4f3e4431500f61f9706a26dc74e1dd7c..4e78d332186c1801dfacb1d8fb250d59461a178d 100644 (file)
 int vms_show = 0;
 #endif
 
+#ifdef __MINGW32__
+/*
+ * There seems to be no way to escape "*" in command-line arguments with MinGW
+ * when command-line argument globbing is enabled under the MSYS shell, so turn
+ * it off.
+ */
+int _CRT_glob = 0;
+#endif /* __MINGW32__ */
+
 /* if we build a static library for unit tests, there is no main() function */
 #ifndef UNITTESTS