1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

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
This commit is contained in:
Hans Wennborg 2014-07-24 21:09:45 +00:00
parent 6af0c82d1f
commit 70dd8bb7a1

View File

@ -213,6 +213,11 @@ WildcardExpand(const wchar_t *Arg, SmallVectorImpl<const char *> &Args,
return ConvertAndPushArg(Arg, Args, Allocator); 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. // Extract any directory part of the argument.
SmallVector<char, MAX_PATH> Dir; SmallVector<char, MAX_PATH> Dir;
if (std::error_code ec = windows::UTF16ToUTF8(Arg, wcslen(Arg), Dir)) if (std::error_code ec = windows::UTF16ToUTF8(Arg, wcslen(Arg), Dir))