Skip to content

Commit

Permalink
chg: use wregex on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
elsamuko committed Jun 12, 2021
1 parent 564b34c commit ce0b681
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/globmatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ GlobMatcher::GlobMatcher( std::string glob ) {
boost::algorithm::replace_all( glob, ".", "\\." );
boost::algorithm::replace_all( glob, "*", ".*" );
boost::algorithm::replace_all( glob, "?", "." );
#if BOOST_OS_WINDOWS
this->regex.assign( toSysString( glob ), rx::regex::normal );
#else
this->regex.assign( glob, rx::regex::normal );
#endif

}
}

Expand Down
4 changes: 4 additions & 0 deletions src/globmatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ class GlobMatcher {
bool matches( const sys_string& filename );
operator bool() const { return !regex.empty(); }
private:
#if BOOST_OS_WINDOWS
rx::wregex regex;
#else
rx::regex regex;
#endif
};

0 comments on commit ce0b681

Please sign in to comment.