summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-09 20:19:07 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-09 20:21:11 (GMT)
commitb1c113d9a79c8ed78bffa63645a146593d19dadc (patch)
tree3eff31b885fd4b10adfa2667c89999bd522d6ffe /Source
parent9e8fa1043ce9bfcffdcfa395f618dd7958ef4251 (diff)
downloadCMake-b1c113d9a79c8ed78bffa63645a146593d19dadc.zip
CMake-b1c113d9a79c8ed78bffa63645a146593d19dadc.tar.gz
CMake-b1c113d9a79c8ed78bffa63645a146593d19dadc.tar.bz2
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')
-rw-r--r--Source/cmListFileCache.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 705666d..3fc5b69 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;
}