Skip to content

Commit 7a4e6da

Browse files
committed
Fix import GUI project problem
1 parent f2bd603 commit 7a4e6da

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/importproject.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,14 +1074,16 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *setti
10741074
guiProject.libraries = readXmlStringList(node, "", CppcheckXml::LibraryElementName, nullptr);
10751075
else if (strcmp(node->Name(), CppcheckXml::SuppressionsElementName) == 0) {
10761076
for (const tinyxml2::XMLElement *child = node->FirstChildElement(); child; child = child->NextSiblingElement()) {
1077-
if (strcmp(child->Name(), CppcheckXml::SuppressionsElementName) != 0)
1077+
if (strcmp(child->Name(), CppcheckXml::SuppressionElementName) != 0)
10781078
continue;
10791079
auto read = [](const char *s, const char *def) {
10801080
return s ? s : def;
10811081
};
10821082
Suppressions::Suppression s;
10831083
s.errorId = read(child->GetText(), "");
10841084
s.fileName = read(child->Attribute("fileName"), "");
1085+
if (!s.fileName.empty())
1086+
s.fileName = joinRelativePath(path, s.fileName);
10851087
s.lineNumber = child->IntAttribute("lineNumber", Suppressions::Suppression::NO_LINE);
10861088
s.symbolName = read(child->Attribute("symbolName"), "");
10871089
std::istringstream(read(child->Attribute("cppcheck-id"), "0")) >> s.cppcheckId;

0 commit comments

Comments
 (0)