ENH: fix crash when glob has wrong number of arguments

This commit is contained in:
Bill Hoffman 2006-06-27 09:56:21 -04:00
parent f372c0f552
commit 8033e32203
1 changed files with 5 additions and 0 deletions

View File

@ -233,6 +233,11 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
}
g.SetRelative(i->c_str());
++i;
if(i == args.end())
{
this->SetError("GLOB requires a glob expression after the directory");
return false;
}
}
if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
{