Resolve CID 1365360

Do not ignore failures to load windows.cfg
This commit is contained in:
Dmitry-Me 2017-08-22 18:09:02 +03:00
parent de9f8b8a3c
commit b6c218b7af
1 changed files with 7 additions and 2 deletions

View File

@ -496,8 +496,13 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
// --project // --project
else if (std::strncmp(argv[i], "--project=", 10) == 0) { else if (std::strncmp(argv[i], "--project=", 10) == 0) {
_settings->project.import(argv[i]+10); _settings->project.import(argv[i]+10);
if (std::strstr(argv[i], ".sln") || std::strstr(argv[i], ".vcxproj")) if (std::strstr(argv[i], ".sln") || std::strstr(argv[i], ".vcxproj")) {
CppCheckExecutor::tryLoadLibrary(_settings->library, argv[0], "windows"); if (!CppCheckExecutor::tryLoadLibrary(_settings->library, argv[0], "windows.cfg")) {
// This shouldn't happen normally.
PrintMessage("cppcheck: Failed to load 'windows.cfg'. Your Cppcheck installation is broken. Please re-install.");
return false;
}
}
} }
// Report progress // Report progress