summaryrefslogtreecommitdiff
path: root/Source/kwsys/Glob.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys/Glob.cxx')
-rw-r--r--Source/kwsys/Glob.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index 68586899ff..80fdf29acd 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);
+ }
}
}
}