diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-07-29 23:27:06 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-07-29 23:27:06 +0000 |
commit | 1b7ea62aa83adf7c18298cf5a8914f3d32728a15 (patch) | |
tree | d3132dd90743431f3bab0450844c34e7e2502889 | |
parent | 3d8fb061a9ca065499d218a8c94746078d426ed2 (diff) | |
download | llvm-1b7ea62aa83adf7c18298cf5a8914f3d32728a15.tar.gz |
Merging r213894:
------------------------------------------------------------------------
r213894 | hans | 2014-07-24 14:09:45 -0700 (Thu, 24 Jul 2014) | 4 lines
Windows: Don't wildcard expand /? or -?
Even if there's a file called c:\a, we want /? to be preserved as
an option, not expanded to a filename.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@214248 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Support/Windows/Process.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Support/Windows/Process.inc b/lib/Support/Windows/Process.inc index 9eeca62d9d66..61749a72727b 100644 --- a/lib/Support/Windows/Process.inc +++ b/lib/Support/Windows/Process.inc @@ -213,6 +213,11 @@ WildcardExpand(const wchar_t *Arg, SmallVectorImpl<const char *> &Args, return ConvertAndPushArg(Arg, Args, Allocator); } + if (wcscmp(Arg, L"/?") == 0 || wcscmp(Arg, L"-?") == 0) { + // Don't wildcard expand /?. Always treat it as an option. + return ConvertAndPushArg(Arg, Args, Allocator); + } + // Extract any directory part of the argument. SmallVector<char, MAX_PATH> Dir; if (std::error_code ec = windows::UTF16ToUTF8(Arg, wcslen(Arg), Dir)) |