diff options
Diffstat (limited to 'src/plugins/cpptools/cpppreprocessor.cpp')
-rw-r--r-- | src/plugins/cpptools/cpppreprocessor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cpppreprocessor.cpp b/src/plugins/cpptools/cpppreprocessor.cpp index dd185a7e39..b276885001 100644 --- a/src/plugins/cpptools/cpppreprocessor.cpp +++ b/src/plugins/cpptools/cpppreprocessor.cpp @@ -235,10 +235,12 @@ QString CppPreprocessor::cleanPath(const QString &path) QString CppPreprocessor::resolveFile_helper(const QString &fileName, IncludeType type) { - const QFileInfo fileInfo(fileName); - if (isInjectedFile(fileName) || fileInfo.isAbsolute()) + if (isInjectedFile(fileName)) return fileName; + if (QFileInfo(fileName).isAbsolute()) + return checkFile(fileName) ? fileName : QString(); + if (type == IncludeLocal && m_currentDoc) { const QFileInfo currentFileInfo(m_currentDoc->fileName()); const QString path = cleanPath(currentFileInfo.absolutePath()) + fileName; |