summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-28 14:58:56 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-28 15:18:53 (GMT)
commit4c8760c9fb2951d897a307637a761c371e48e615 (patch)
tree09c4406eacf7c3414339a96bc14f60d31a96dd74 /Source/cmFindBase.cxx
parent40bbe50e23c06232ccf1c49589dde5dd84e1ac31 (diff)
downloadCMake-4c8760c9fb2951d897a307637a761c371e48e615.zip
CMake-4c8760c9fb2951d897a307637a761c371e48e615.tar.gz
CMake-4c8760c9fb2951d897a307637a761c371e48e615.tar.bz2
find_path: Fix crash on empty old-style list of names
Fixes: #19651
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index e590802..42aff04 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -141,7 +141,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
// look for old style
// FIND_*(VAR name path1 path2 ...)
- if (!newStyle) {
+ if (!newStyle && !this->Names.empty()) {
// All the short-hand arguments have been recorded as names.
std::vector<std::string> shortArgs = this->Names;
this->Names.clear(); // clear out any values in Names