logic: Fixed crash when Project Paths contain files and lazy include search in enabled

bug id = 201
This commit is contained in:
Eberhard Graether
2016-10-20 23:20:46 +02:00
parent 06c7a4e159
commit a5613715db
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ std::vector<FilePath> FileSystem::getSubDirectories(const FilePath &path)
{
std::vector<FilePath> v;
if (!path.exists())
if (!path.exists() || !path.isDirectory())
{
return v;
}
+3 -3
View File
@@ -95,7 +95,7 @@ Parser::Arguments CxxProject::getParserArguments() const
utility::append(args.compilerFlags, m_projectSettings->getCompilerFlags());
// Add the source paths as HeaderSearchPaths as well, so clang will also look here when searching include files.
for (const FilePath& sourcePath: getSourcePaths())
for (const FilePath& sourcePath : getSourcePaths())
{
if (sourcePath.isDirectory())
{
@@ -111,9 +111,9 @@ Parser::Arguments CxxProject::getParserArguments() const
if (m_projectSettings->getUseSourcePathsForHeaderSearch())
{
std::vector<FilePath> headerSearchSubPaths;
for (FilePath p : m_projectSettings->getSourcePaths())
for (const FilePath& sourcePath : getSourcePaths())
{
utility::append(headerSearchSubPaths, FileSystem::getSubDirectories(p));
utility::append(headerSearchSubPaths, FileSystem::getSubDirectories(sourcePath));
}
utility::append(args.systemHeaderSearchPaths, utility::unique(headerSearchSubPaths));