From 5abddd448eaaacdc535034d94a6023da9eec86ee Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 19 Feb 2026 22:12:59 +0200 Subject: [PATCH] LibC: Fix typo/bug in fnmatch * would stop matching at '0' instead of end of string --- userspace/libraries/LibC/fnmatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/libraries/LibC/fnmatch.cpp b/userspace/libraries/LibC/fnmatch.cpp index 2b13e2ff..cae3b6ea 100644 --- a/userspace/libraries/LibC/fnmatch.cpp +++ b/userspace/libraries/LibC/fnmatch.cpp @@ -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;