summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2017-08-21 21:35:46 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2017-08-22 09:21:23 +0200
commit88220adb72c5cb00e3c8d0886ebe687edf842cd8 (patch)
tree14b615e1e0c49c8d80c5cdec4051272b283d0cde /src
parent43fb867a58202bcccbbfa92fe819cec79be19468 (diff)
downloadcurl-88220adb72c5cb00e3c8d0886ebe687edf842cd8.tar.gz
tool_main: turn off MinGW CRT's globbing
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
Diffstat (limited to 'src')
-rw-r--r--src/tool_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tool_main.c b/src/tool_main.c
index 089a317d4..4e78d3321 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -62,6 +62,15 @@
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