Skip to content

Commit b6c218b

Browse files
committed
Resolve CID 1365360
Do not ignore failures to load windows.cfg
1 parent de9f8b8 commit b6c218b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cli/cmdlineparser.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,13 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
496496
// --project
497497
else if (std::strncmp(argv[i], "--project=", 10) == 0) {
498498
_settings->project.import(argv[i]+10);
499-
if (std::strstr(argv[i], ".sln") || std::strstr(argv[i], ".vcxproj"))
500-
CppCheckExecutor::tryLoadLibrary(_settings->library, argv[0], "windows");
499+
if (std::strstr(argv[i], ".sln") || std::strstr(argv[i], ".vcxproj")) {
500+
if (!CppCheckExecutor::tryLoadLibrary(_settings->library, argv[0], "windows.cfg")) {
501+
// This shouldn't happen normally.
502+
PrintMessage("cppcheck: Failed to load 'windows.cfg'. Your Cppcheck installation is broken. Please re-install.");
503+
return false;
504+
}
505+
}
501506
}
502507

503508
// Report progress

0 commit comments

Comments
 (0)