Skip to content

Commit

Permalink
Merge pull request #5 from fdinel/master
Browse files Browse the repository at this point in the history
Add support for path beginning with parent directory (..)
  • Loading branch information
p-ranav authored Mar 16, 2021
2 parents c2a798a + c6f1523 commit 238f674
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion single_include/glob/glob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ bool has_magic(const std::string &pathname) {
}

static inline
bool is_hidden(const std::string &pathname) { return pathname[0] == '.'; }
bool is_hidden(const std::string &pathname) {
return std::regex_match(pathname, std::regex("^(.*\\/)*\\.[^\\.\\/]+\\/*$"));
}

static inline
bool is_recursive(const std::string &pattern) { return pattern == "**"; }
Expand Down

0 comments on commit 238f674

Please sign in to comment.