[llvm] r213894 - Windows: Don't wildcard expand /? or -?

Hans Wennborg hans at hanshq.net
Thu Jul 24 14:09:46 PDT 2014


Author: hans
Date: Thu Jul 24 16:09:45 2014
New Revision: 213894

URL: http://llvm.org/viewvc/llvm-project?rev=213894&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Support/Windows/Process.inc

Modified: llvm/trunk/lib/Support/Windows/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Process.inc?rev=213894&r1=213893&r2=213894&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Process.inc (original)
+++ llvm/trunk/lib/Support/Windows/Process.inc Thu Jul 24 16:09:45 2014
@@ -213,6 +213,11 @@ WildcardExpand(const wchar_t *Arg, Small
     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))





More information about the llvm-commits mailing list