>From 9986df19c31f2c8874bb2f3fc158969ae68d976d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 5 Oct 2026 19:57:45 -0400 Subject: [PATCH 2/6] fnmatch: don't call wctype twice per character class save the result and use for both the original character and the potentially case-folded version. --- src/regex/fnmatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regex/fnmatch.c b/src/regex/fnmatch.c index f6f2bf63..85e8cc41 100644 --- a/src/regex/fnmatch.c +++ b/src/regex/fnmatch.c @@ -137,8 +137,8 @@ static int match_bracket(const char *p, int k, int kfold) char buf[16]; memcpy(buf, p0, p-1-p0); buf[p-1-p0] = 0; - if (iswctype(k, wctype(buf)) || - iswctype(kfold, wctype(buf))) + wctype_t type = wctype(buf); + if (iswctype(k, type) || iswctype(kfold, type)) return !inv; } continue; -- 2.21.0