diff --git a/Glob.cxx b/Glob.cxx
index 6ac6b97f87f8ab1df32e52de4b6d0a0ae76b82fb..ef35a40ee6be7088b2db084d359ae699243e3dbe 100644
--- a/Glob.cxx
+++ b/Glob.cxx
@@ -273,7 +273,7 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
       if ( !this->Internals->Expressions.empty() &&
            this->Internals->Expressions.rbegin()->find(fname) )
         {
-        this->AddFile(this->Internals->Files, realname.c_str());
+        this->AddFile(this->Internals->Files, realname);
         }
       }
     }
@@ -351,7 +351,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
       {
       if ( last )
         {
-        this->AddFile(this->Internals->Files, realname.c_str());
+        this->AddFile(this->Internals->Files, realname);
         }
       else
         {
@@ -497,11 +497,11 @@ const char* Glob::GetRelative()
 }
 
 //----------------------------------------------------------------------------
-void Glob::AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const char* file)
+void Glob::AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const kwsys_stl::string& file)
 {
   if ( !this->Relative.empty() )
     {
-    files.push_back(kwsys::SystemTools::RelativePath(this->Relative.c_str(), file));
+    files.push_back(kwsys::SystemTools::RelativePath(this->Relative.c_str(), file.c_str()));
     }
   else
     {
diff --git a/Glob.hxx.in b/Glob.hxx.in
index 88c343ce00646ff4de173d7e8543eac0c89ce798..806c680cb1900d200b48e4eb8f6e7eacf2bb2661 100644
--- a/Glob.hxx.in
+++ b/Glob.hxx.in
@@ -94,7 +94,7 @@ protected:
   void AddExpression(const char* expr);
 
   //! Add a file to the list
-  void AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const char* file);
+  void AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const kwsys_stl::string& file);
 
   GlobInternals* Internals;
   bool Recurse;