From b6c218b7af6b35d5198fe8ae4acf344cfaf61a68 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 22 Aug 2017 18:09:02 +0300 Subject: [PATCH] Resolve CID 1365360 Do not ignore failures to load windows.cfg --- cli/cmdlineparser.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 8f4650a78..17cd51590 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -496,8 +496,13 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[]) // --project else if (std::strncmp(argv[i], "--project=", 10) == 0) { _settings->project.import(argv[i]+10); - if (std::strstr(argv[i], ".sln") || std::strstr(argv[i], ".vcxproj")) - CppCheckExecutor::tryLoadLibrary(_settings->library, argv[0], "windows"); + if (std::strstr(argv[i], ".sln") || std::strstr(argv[i], ".vcxproj")) { + 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