From 45265d996b4e8e9e138d7ee9d75c02ffe0149676 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 11 Sep 2018 21:02:03 +0000 Subject: [PATCH] [Support] Quote arguments containing \n on Windows Fixes at_file.c test failure caused by r341988. We may want to change how we treat \n in our tokenizer, but this is probably a good fix regardless, since we can invoke all kinds of programs with different interpretations of the command line quoting rules. llvm-svn: 341992 --- llvm/lib/Support/Windows/Program.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/Windows/Program.inc b/llvm/lib/Support/Windows/Program.inc index cb68c5b..88c56bc 100644 --- a/llvm/lib/Support/Windows/Program.inc +++ b/llvm/lib/Support/Windows/Program.inc @@ -317,7 +317,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program, static bool argNeedsQuotes(StringRef Arg) { if (Arg.empty()) return true; - return StringRef::npos != Arg.find_first_of("\t \"&\'()*<>\\`^|"); + return StringRef::npos != Arg.find_first_of("\t \"&\'()*<>\\`^|\n"); } static std::string quoteSingleArg(StringRef Arg) { -- 2.7.4