diff --git a/Glob.cxx b/Glob.cxx index ef35a40ee6be7088b2db084d359ae699243e3dbe..8569b0e804f590b092016a2b9f5aa3334268e180 100644 --- a/Glob.cxx +++ b/Glob.cxx @@ -441,7 +441,7 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) { if ( !cexpr.empty() ) { - this->AddExpression(cexpr.c_str()); + this->AddExpression(cexpr); } cexpr = ""; } @@ -452,7 +452,7 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) } if ( !cexpr.empty() ) { - this->AddExpression(cexpr.c_str()); + this->AddExpression(cexpr); } // Handle network paths @@ -468,11 +468,11 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) } //---------------------------------------------------------------------------- -void Glob::AddExpression(const char* expr) +void Glob::AddExpression(const kwsys_stl::string& expr) { this->Internals->Expressions.push_back( kwsys::RegularExpression( - this->PatternToRegex(expr).c_str())); + this->PatternToRegex(expr))); } //---------------------------------------------------------------------------- diff --git a/Glob.hxx.in b/Glob.hxx.in index 806c680cb1900d200b48e4eb8f6e7eacf2bb2661..d8b8491dc4b13c628dc0c1e1dafc767937db9c15 100644 --- a/Glob.hxx.in +++ b/Glob.hxx.in @@ -91,7 +91,7 @@ protected: const kwsys_stl::string& dir); //! Add regular expression - void AddExpression(const char* expr); + void AddExpression(const kwsys_stl::string& expr); //! Add a file to the list void AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const kwsys_stl::string& file);