mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
file: remove dead code
The file command requires at least two arguments, so guarding the GLOB and MAKE_DIRECTORY command is not necessary. Changed it for an assert to keep the protection.
This commit is contained in:
committed by
Rolf Eike Beer
parent
07251a8ea5
commit
c2a6cb64af
@@ -22,6 +22,7 @@
|
||||
#endif
|
||||
|
||||
#undef GetCurrentDirectory
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -705,11 +706,8 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
|
||||
bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
|
||||
bool recurse)
|
||||
{
|
||||
if ( args.size() < 2 )
|
||||
{
|
||||
this->SetError("GLOB requires at least a variable name");
|
||||
return false;
|
||||
}
|
||||
// File commands has at least one argument
|
||||
assert(args.size() > 1);
|
||||
|
||||
std::vector<std::string>::const_iterator i = args.begin();
|
||||
|
||||
@@ -843,11 +841,8 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
|
||||
bool cmFileCommand::HandleMakeDirectoryCommand(
|
||||
std::vector<std::string> const& args)
|
||||
{
|
||||
if(args.size() < 2 )
|
||||
{
|
||||
this->SetError("called with incorrect number of arguments");
|
||||
return false;
|
||||
}
|
||||
// File command has at least one argument
|
||||
assert(args.size() > 1);
|
||||
|
||||
std::vector<std::string>::const_iterator i = args.begin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user