summaryrefslogtreecommitdiff
path: root/Source/cmListFileCache.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-09 16:19:07 -0400
committerBrad King <brad.king@kitware.com>2014-06-09 16:21:11 -0400
commitb1c113d9a79c8ed78bffa63645a146593d19dadc (patch)
tree3eff31b885fd4b10adfa2667c89999bd522d6ffe /Source/cmListFileCache.cxx
parent9e8fa1043ce9bfcffdcfa395f618dd7958ef4251 (diff)
downloadcmake-b1c113d9a79c8ed78bffa63645a146593d19dadc.tar.gz
cmake: Do not open directories as scripts (#14966)
Check if a file path is a directory before opening it. Extend the RunCMake.CommandLine test with a case running "cmake -P" on a directory.
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r--Source/cmListFileCache.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 705666d81c..3fc5b69c46 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -142,7 +142,8 @@ bool cmListFile::ParseFile(const char* filename,
bool topLevel,
cmMakefile *mf)
{
- if(!cmSystemTools::FileExists(filename))
+ if(!cmSystemTools::FileExists(filename) ||
+ cmSystemTools::FileIsDirectory(filename))
{
return false;
}