Small fixes

This commit is contained in:
Adrian Ebeling 2019-01-20 14:15:06 +01:00
parent ed548b11da
commit a57957702e
2 changed files with 2 additions and 1 deletions

View File

@ -161,7 +161,7 @@ std::string GetExternalCommandOutput(const std::vector<std::string> &command,
// fold the command line parts into a single string, quoting the arguments
std::string cmdString;
for (int i = 0; i < command.size(); i++) {
cmdString += ((i > 0) ? " \"" : "\"") + command[i] + "\"";
cmdString += ((i == 0) ? command[i] : (" \"" + command[i] + "\"")) ;
}
std::wstring cmdString_u16 = Utf8To16(cmdString.c_str());

View File

@ -351,6 +351,7 @@ void Project::LoadDirectory(const std::string &root, Project::Folder &folder) {
std::string err_msg;
std::unique_ptr<tooling::CompilationDatabase> CDB =
tooling::CompilationDatabase::loadFromDirectory(CDBDir, err_msg);
if(err_msg.size() > 0) LOG_S(ERROR) << err_msg;
if (!g_config->compilationDatabaseCommand.empty()) {
RemoveDirectoryRecursive(CDBDir.c_str());
}