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
This commit is contained in:
Brad King
2017-01-16 10:37:42 -05:00
parent 85a8939e2f
commit 2bba0bfc2c
3 changed files with 3 additions and 1 deletions

View File

@@ -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")) {