1. Jason R. Coombs
  2. gcc-xml

Commits

hoffman  committed 06d4319

ENH: 2.6.2 RC 4 merge into main tree

  • Participants
  • Parent commits 09f0535
  • Branches CMake-2-6
  • Tags CMake-2-6-2

Comments (0)

Files changed (2)

File GCC_XML/KWSys/Glob.cxx

View file
   this->RecurseThroughSymlinks = true;
     // RecurseThroughSymlinks is true by default for backwards compatibility,
     // not because it's a good idea...
+  this->FollowedSymlinkCount = 0;
 }
 
 //----------------------------------------------------------------------------
       }
     if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
       {
-      if (!kwsys::SystemTools::FileIsSymlink(realname.c_str()) ||
-        this->RecurseThroughSymlinks)
+      bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
+      if (!isSymLink || this->RecurseThroughSymlinks)
         {
+        if (isSymLink)
+          {
+          ++this->FollowedSymlinkCount;
+          }
         this->RecurseDirectory(start+1, realname, dir_only);
         }
       }

File GCC_XML/KWSys/Glob.hxx.in

View file
   void SetRecurseThroughSymlinks(bool i) { this->RecurseThroughSymlinks = i; }
   bool GetRecurseThroughSymlinks() { return this->RecurseThroughSymlinks; }
 
+  //! Get the number of symlinks followed through recursion
+  unsigned int GetFollowedSymlinkCount() { return this->FollowedSymlinkCount; }
+
   //! Set relative to true to only show relative path to files.
   void SetRelative(const char* dir);
   const char* GetRelative();
   bool Recurse;
   kwsys_stl::string Relative;
   bool RecurseThroughSymlinks;
+  unsigned int FollowedSymlinkCount;
 
 private:
   Glob(const Glob&);  // Not implemented.