diff options
Diffstat (limited to 'Source/kwsys/Glob.cxx')
-rw-r--r-- | Source/kwsys/Glob.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index 6858689..80fdf29 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -63,6 +63,10 @@ Glob::Glob() this->Internals = new GlobInternals; this->Recurse = false; this->Relative = ""; + + this->RecurseThroughSymlinks = true; + // RecurseThroughSymlinks is true by default for backwards compatibility, + // not because it's a good idea... } //---------------------------------------------------------------------------- @@ -262,7 +266,11 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, } if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) { - this->RecurseDirectory(start+1, realname, dir_only); + if (!kwsys::SystemTools::FileIsSymlink(realname.c_str()) || + this->RecurseThroughSymlinks) + { + this->RecurseDirectory(start+1, realname, dir_only); + } } } } |