Attempt 3: Resubmit "[Support] Expose flattenWindowsCommandLine."

I took some liberties and quoted fewer characters than before,
based on an article from MSDN which says that only certain characters
cause an arg to require quoting.  This seems to be incorrect, though,
and worse it seems to be a difference in Windows version.  The bot
that fails is Windows 7, and I can't reproduce the failure on Win
10.  But it's definitely related to quoting and special characters,
because both tests that fail have a * in the argument, which is one
of the special characters that would cause an argument to be quoted
before but not any longer after the new patch.

Since I don't have Win 7, all I can do is just guess that I need to
restore the old quoting rules.  So this patch does that in hopes that
it fixes the problem on Windows 7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2018-06-10 20:57:14 +00:00
parent e956ae9dc3
commit 07d33bf7d7
5 changed files with 99 additions and 122 deletions
+9
View File
@@ -63,6 +63,15 @@ ProcessInfo sys::ExecuteNoWait(StringRef Program, const char **Args,
return PI;
}
bool sys::commandLineFitsWithinSystemLimits(StringRef Program,
ArrayRef<const char *> Args) {
SmallVector<StringRef, 8> StringRefArgs;
StringRefArgs.reserve(Args.size());
for (const char *A : Args)
StringRefArgs.emplace_back(A);
return commandLineFitsWithinSystemLimits(Program, StringRefArgs);
}
// Include the platform-specific parts of this class.
#ifdef LLVM_ON_UNIX
#include "Unix/Program.inc"