LibC: Fix typo/bug in fnmatch

* would stop matching at '0' instead of end of string
This commit is contained in:
Bananymous 2026-02-19 22:12:59 +02:00
parent f022a1b08f
commit 5abddd448e
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ static int fnmatch_impl(const char* pattern, const char* string, int flags, bool
{
case '*':
{
const char* ptr = strchrnul(string, (flags & FNM_PATHNAME) ? '/' : '0');
const char* ptr = strchrnul(string, (flags & FNM_PATHNAME) ? '/' : '\0');
while (ptr >= string)
if (fnmatch_impl(pattern + 1, ptr--, flags, false) == 0)
return 0;