summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/Glob.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-09-06 17:07:52 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-09-06 17:10:05 (GMT)
commit98cb017a9deca35cd9a67e03b6bd95064b6d2fb7 (patch)
tree7c72c87ba88adc57c9d3553952f79f7f2c054de0 /Source/kwsys/Glob.cxx
parent5b4528b1f45a2a7d1ef5effe9813b1a2d764ac60 (diff)
downloadCMake-98cb017a9deca35cd9a67e03b6bd95064b6d2fb7.zip
CMake-98cb017a9deca35cd9a67e03b6bd95064b6d2fb7.tar.gz
CMake-98cb017a9deca35cd9a67e03b6bd95064b6d2fb7.tar.bz2
KWSys: Remove always-true dir_only parameter
Its presence confuses, and, since it is always true, is useless.
Diffstat (limited to 'Source/kwsys/Glob.cxx')
-rw-r--r--Source/kwsys/Glob.cxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index c1f5100..b33b926 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -215,7 +215,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
//----------------------------------------------------------------------------
void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only)
+ const kwsys_stl::string& dir)
{
kwsys::Directory d;
if ( !d.Load(dir.c_str()) )
@@ -258,7 +258,9 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
fullname = dir + "/" + fname;
}
- if ( !dir_only || !kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
+ bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str());
+
+ if ( !isDir )
{
if ( (this->Internals->Expressions.size() > 0) &&
this->Internals->Expressions[
@@ -267,7 +269,7 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
this->AddFile(this->Internals->Files, realname.c_str());
}
}
- if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
+ else
{
bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
if (!isSymLink || this->RecurseThroughSymlinks)
@@ -276,7 +278,7 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
{
++this->FollowedSymlinkCount;
}
- this->RecurseDirectory(start+1, realname, dir_only);
+ this->RecurseDirectory(start+1, realname);
}
}
}
@@ -284,13 +286,13 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
//----------------------------------------------------------------------------
void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only)
+ const kwsys_stl::string& dir)
{
//kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl;
bool last = ( start == this->Internals->Expressions.size()-1 );
if ( last && this->Recurse )
{
- this->RecurseDirectory(start, dir, dir_only);
+ this->RecurseDirectory(start, dir);
return;
}
@@ -345,7 +347,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
// << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl;
//kwsys_ios::cout << "Full name: " << fullname << kwsys_ios::endl;
- if ( (!dir_only || !last) &&
+ if ( !last &&
!kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
{
continue;
@@ -359,7 +361,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
}
else
{
- this->ProcessDirectory(start+1, realname + "/", dir_only);
+ this->ProcessDirectory(start+1, realname + "/");
}
}
}
@@ -462,12 +464,11 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr)
// Handle network paths
if ( skip > 0 )
{
- this->ProcessDirectory(0, fexpr.substr(0, skip) + "/",
- true);
+ this->ProcessDirectory(0, fexpr.substr(0, skip) + "/");
}
else
{
- this->ProcessDirectory(0, "/", true);
+ this->ProcessDirectory(0, "/");
}
return true;
}