Index: ToolRunner.cpp =================================================================== --- ToolRunner.cpp +++ ToolRunner.cpp @@ -382,29 +382,29 @@ // first argument is the PATH. // Skip repeated whitespace, leading whitespace and trailing whitespace. - for (std::size_t Pos = 0u; Pos <= CommandLine.size(); ++Pos) { - if ('\\' == CommandLine[Pos]) { - if (Pos + 1 < CommandLine.size()) - Token.push_back(CommandLine[++Pos]); - - continue; - } - if (' ' == CommandLine[Pos] || CommandLine.size() == Pos) { - if (Token.empty()) - continue; - - if (!FoundPath) { - Command = Token; - FoundPath = true; - Token.clear(); - continue; + for (std::size_t Pos = 0u; Pos <= CommandLine.size (); ++Pos) { + if (CommandLine.size () == Pos || ' ' == CommandLine [Pos]) + { + if (Token.empty ()) + continue; + + if (!FoundPath) { + Command = Token; + Token.clear (); + FoundPath = true; + continue; + } + + Args.push_back (Token); + Token.clear (); + continue; } - - Args.push_back(Token); - Token.clear(); - continue; - } - Token.push_back(CommandLine[Pos]); + else if ('\\' == CommandLine [Pos]) { + if (Pos + 1 < CommandLine.size ()) + Token.push_back (CommandLine [++Pos]); + continue; + } + Token.push_back (CommandLine [Pos]); } auto Path = sys::findProgramByName(Command);