summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-01-17 14:04:53 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-01-17 14:04:53 (GMT)
commit65124233da4b3e53643c896d38602318fcc549f0 (patch)
treef8f3628be6038da399511d6eda2298ed0e98cff4
parentaa63ab6d3e7bf320f17a5364a596355e3ab976e0 (diff)
parent2bba0bfc2c113a1ec94802ecfb8a836a385f919b (diff)
downloadCMake-65124233da4b3e53643c896d38602318fcc549f0.zip
CMake-65124233da4b3e53643c896d38602318fcc549f0.tar.gz
CMake-65124233da4b3e53643c896d38602318fcc549f0.tar.bz2
Merge topic 'file-GLOB-empty-no-crash'
2bba0bfc file: Fix crash on GLOB with no expressions after LIST_DIRECTORIES
-rw-r--r--Source/cmFileCommand.cxx2
-rw-r--r--Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES.cmake1
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake1
3 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d10c886..91cecb3 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -788,7 +788,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
this->SetError("LIST_DIRECTORIES missing bool value.");
return false;
}
- ++i;
+ continue;
}
if (recurse && (*i == "FOLLOW_SYMLINKS")) {
diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES.cmake b/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES.cmake
new file mode 100644
index 0000000..37a9d54
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES.cmake
@@ -0,0 +1 @@
+file(GLOB CONTENT_LIST LIST_DIRECTORIES false)
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 48fa757..7497544 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -31,6 +31,7 @@ run_cmake(GLOB_RECURSE)
run_cmake(GLOB-error-LIST_DIRECTORIES-not-boolean)
# test is valid both for GLOB and GLOB_RECURSE
run_cmake(GLOB-error-LIST_DIRECTORIES-no-arg)
+run_cmake(GLOB-noexp-LIST_DIRECTORIES)
if(NOT WIN32 OR CYGWIN)
run_cmake(GLOB_RECURSE-cyclic-recursion)