CLI: fix execute command, quote argument that contains spaces

This commit is contained in:
Daniel Marjamäki 2020-08-30 20:02:18 +02:00
parent d23fd26ce0
commit dc6f0740c1
1 changed files with 4 additions and 1 deletions

View File

@ -1176,6 +1176,9 @@ bool CppCheckExecutor::executeCommand(std::string exe, std::vector<std::string>
for (const std::string &arg : args) {
if (!joinedArgs.empty())
joinedArgs += " ";
if (arg.find(" ") != std::string::npos)
joinedArgs += '"' + arg + '"';
else
joinedArgs += arg;
}