summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-07-24 21:09:45 +0000
committerHans Wennborg <hans@hanshq.net>2014-07-24 21:09:45 +0000
commite34a71aa91b68853a95d74bd9f0e249cb1d6a42e (patch)
treefedbcd36fda0d1e349440af12000957b827a6f5a /llvm/lib/Support
parent3175daa9501bf737856a019316809956afd2843e (diff)
downloadbcm5719-llvm-e34a71aa91b68853a95d74bd9f0e249cb1d6a42e.tar.gz
bcm5719-llvm-e34a71aa91b68853a95d74bd9f0e249cb1d6a42e.zip
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. llvm-svn: 213894
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Windows/Process.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/Process.inc b/llvm/lib/Support/Windows/Process.inc
index 9eeca62d9d6..61749a72727 100644
--- a/llvm/lib/Support/Windows/Process.inc
+++ b/llvm/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))
OpenPOWER on IntegriCloud