diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -295,11 +295,10 @@ if (flags & FNM_CASEFOLD) c2 = towlower(c2); - if (table->__collate_load_error ? + if (table->__collate_load_error || MB_CUR_MAX > 1 ? c <= test && test <= c2 : - __wcollate_range_cmp(c, test) <= 0 - && __wcollate_range_cmp(test, c2) <= 0 - ) + __wcollate_range_cmp(c, test) <= 0 && + __wcollate_range_cmp(test, c2) <= 0) ok = 1; } else if (c == test) ok = 1;