diff --git a/src/libs/utils/outputformatter.cpp b/src/libs/utils/outputformatter.cpp index 4efcae76468..cf6930cbe57 100644 --- a/src/libs/utils/outputformatter.cpp +++ b/src/libs/utils/outputformatter.cpp @@ -136,8 +136,10 @@ bool OutputLineParser::demoteErrorsToWarnings() const FilePath OutputLineParser::absoluteFilePath(const FilePath &filePath) const { - if (filePath.isEmpty() || filePath.toFileInfo().isAbsolute()) + if (filePath.isEmpty()) return filePath; + if (filePath.toFileInfo().isAbsolute()) + return filePath.cleanPath(); FilePaths candidates; for (const FilePath &dir : searchDirectories()) { FilePath candidate = dir.pathAppended(filePath.toString()); diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 6479240c2b0..30ebe45bf82 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -1367,6 +1367,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() CompileTask(Task::Error, ".pch/Qt6Core5Compat: No such file or directory", ".pch/Qt6Core5Compat"), CompileTask(Task::Warning, "-Wformat-security ignored without -Wformat [-Wformat-security]")} << QString(); + + QTest::newRow("clean path") + << QString("/home/tim/path/to/sources/./and/more.h:15:22: error: blubb") + << OutputParserTester::STDERR + << QString() << QString() + << Tasks{CompileTask(Task::Error, "blubb", "/home/tim/path/to/sources/and/more.h", + 15, 22)} + << QString(); } void ProjectExplorerPlugin::testGccOutputParsers()