diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 9769521e1..45cb34002 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1480,7 +1480,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check // file's location directory as root path if (rootpath.isEmpty() || rootpath == ".") mCurrentDirectory = inf.canonicalPath(); - else if (rootpath.startsWith(".")) + else if (rootpath.startsWith("./")) mCurrentDirectory = inf.canonicalPath() + rootpath.mid(1); else mCurrentDirectory = rootpath; @@ -1488,7 +1488,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check if (!projectFile->getBuildDir().isEmpty()) { QString buildDir = projectFile->getBuildDir(); if (!QDir::isAbsolutePath(buildDir)) - buildDir = mCurrentDirectory + '/' + buildDir; + buildDir = inf.canonicalPath() + '/' + buildDir; if (!QDir(buildDir).exists()) { QMessageBox msg(QMessageBox::Critical, tr("Cppcheck"),