aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-11-16 15:14:15 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2016-11-18 10:23:18 +0000
commit4abb5ae0e1d4b80c0dc6e5dc3ffd26cd4a52d22b (patch)
tree48fbee76a1c616b85852104885cb8d5692fc06d2
parentee8d52cab8afbef98ba762d80bd7ab3df61f6bed (diff)
Input scanner: Prevent resolving directories as included files
This can otherwise easily happen, in particular with C++ standard library headers that don't have file extensions. Change-Id: I30529271278f567e6cb26054ea3b01df7efcfbfa Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index e0d0726c3..e24d603fe 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -103,7 +103,10 @@ static void resolveWithIncludePath(const QString &includePath,
}
QString absFilePath = absDirPath + QLatin1Char('/') + dependency.fileName();
- if (FileInfo::exists(absFilePath))
+
+ // TODO: We probably need a flag that tells us whether directories are allowed.
+ const FileInfo fi(absFilePath);
+ if (fi.exists(absFilePath) && !fi.isDir())
result->filePath = absFilePath;
}