Change whitelist behavior so it is more likely what the user wants.

This commit is contained in:
Jacob Dufault 2017-10-24 18:09:02 -07:00
parent 58f2107714
commit 93d3b2b3cb

View File

@ -61,11 +61,8 @@ GroupMatch::GroupMatch(const std::vector<std::string>& whitelist,
bool GroupMatch::IsMatch(const std::string& value,
std::string* match_failure_reason) const {
for (const Matcher& m : whitelist) {
if (!m.IsMatch(value)) {
if (match_failure_reason)
*match_failure_reason = "whitelist \"" + m.regex_string + "\"";
return false;
}
if (m.IsMatch(value))
return true;
}
for (const Matcher& m : blacklist) {