Partial fix for #12254 (cppcheck.cfg can't be loaded from relative paths anymore) (#5760)

This commit is contained in:
Daniel Marjamäki 2023-12-13 06:53:03 +01:00 committed by GitHub
parent b26b78b86d
commit bc5023775d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -1629,10 +1629,10 @@ void CmdLineParser::printHelp() const
mLogger.printRaw(oss.str());
}
bool CmdLineParser::isCppcheckPremium() {
Settings settings;
settings.loadCppcheckCfg(); // TODO: how to handle errors?
return startsWith(settings.cppcheckCfgProductName, "Cppcheck Premium");
bool CmdLineParser::isCppcheckPremium() const {
if (mSettings.cppcheckCfgProductName.empty())
mSettings.loadCppcheckCfg();
return startsWith(mSettings.cppcheckCfgProductName, "Cppcheck Premium");
}
bool CmdLineParser::tryLoadLibrary(Library& destination, const std::string& basepath, const char* filename)

View File

@ -111,7 +111,7 @@ protected:
void printHelp() const;
private:
static bool isCppcheckPremium();
bool isCppcheckPremium() const;
template<typename T>
bool parseNumberArg(const char* const arg, std::size_t offset, T& num, bool mustBePositive = false)