Skip to content

Commit 664a745

Browse files
committed
Fix empty regex
1 parent a2ca95a commit 664a745

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/pathmatch.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ PathMatch::PathMatch(const std::vector<std::string> &paths, bool caseSensitive)
8686
}
8787
}
8888

89+
if (regex_string.empty())
90+
regex_string = "^$";
91+
8992
if (caseSensitive)
9093
mRegex = std::regex(regex_string, std::regex_constants::extended);
9194
else

0 commit comments

Comments
 (0)