Fixed logic in tr_wildmat (#4353)

This commit is contained in:
Cœur 2022-12-13 06:35:40 +08:00 committed by GitHub
parent 3354634605
commit 9e0b42a61d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ bool tr_wildmat(std::string_view text, std::string_view pattern)
{
// TODO(ckerr): replace wildmat with base/strings/pattern.cc
// wildmat wants these to be zero-terminated.
return pattern == "*"sv || DoMatch(std::string{ text }.c_str(), std::string{ pattern }.c_str()) != 0;
return pattern == "*"sv || DoMatch(std::string{ text }.c_str(), std::string{ pattern }.c_str()) > 0;
}
char const* tr_strerror(int errnum)