[Cmake-commits] CMake branch, next, updated. v3.7.2-2165-g6467c32
Brad King
brad.king at kitware.com
Mon Jan 16 10:49:19 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 6467c32f052d977cfc7bc93c02c20103954225f7 (commit)
via 2bba0bfc2c113a1ec94802ecfb8a836a385f919b (commit)
from 2650902e29becd6442d99ec47b9e8f76ecb3d59f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6467c32f052d977cfc7bc93c02c20103954225f7
commit 6467c32f052d977cfc7bc93c02c20103954225f7
Merge: 2650902 2bba0bf
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 16 10:49:18 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 16 10:49:18 2017 -0500
Merge topic 'file-GLOB-empty-no-crash' into next
2bba0bfc file: Fix crash on GLOB with no expressions after LIST_DIRECTORIES
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2bba0bfc2c113a1ec94802ecfb8a836a385f919b
commit 2bba0bfc2c113a1ec94802ecfb8a836a385f919b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 16 10:37:42 2017 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 16 10:47:32 2017 -0500
file: Fix crash on GLOB with no expressions after LIST_DIRECTORIES
Since commit v3.3.0-rc1~318^2~1 (file: Teach GLOB to list directories
optionally, 2015-03-17) using `LIST_DIRECTORIES` followed by no
expression causes a crash. Fix the logic to avoid the crash.
Fixes: #16565
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)
-----------------------------------------------------------------------
Summary of changes:
Source/cmFileCommand.cxx | 2 +-
Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES.cmake | 1 +
Tests/RunCMake/file/RunCMakeTest.cmake | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list