diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-02-19 14:23:53 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-02-19 14:40:29 +0100 |
commit | 064e4bb8bb4236822c23ed63d419ba081f1e524a (patch) | |
tree | a008f62907b97d2e925625c45ab10175862faed0 /winsup/cygwin/libc/fnmatch.c | |
parent | f0417a620182083fa787eea90e2e1d9884c8e573 (diff) | |
download | newlib-064e4bb8bb4236822c23ed63d419ba081f1e524a.zip newlib-064e4bb8bb4236822c23ed63d419ba081f1e524a.tar.gz newlib-064e4bb8bb4236822c23ed63d419ba081f1e524a.tar.bz2 |
Cygwin: convert __collate_range_cmp to __wcollate_range_cmp
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=179721
After FreeBSD eventually picked up the bugreport from within
only 5 years, rename __collate_range_cmp to __wcollate_range_cmp
as suggested all along, and make it type safe (wint_t instead of
wchar_t for hopefully obvious reasons...)
While at it, drop __collate_load_error and fix the checks for
it in glob and fnmatch.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/libc/fnmatch.c')
-rw-r--r-- | winsup/cygwin/libc/fnmatch.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/winsup/cygwin/libc/fnmatch.c b/winsup/cygwin/libc/fnmatch.c index 40c1f2d..dfbe386 100644 --- a/winsup/cygwin/libc/fnmatch.c +++ b/winsup/cygwin/libc/fnmatch.c @@ -330,18 +330,14 @@ rangematch(const char *pattern, wint_t test, int flags, char **newp, c2 = towlower(c2); #ifdef __CYGWIN__ - if (__collate_load_error ? - c <= test && test <= c2 : - __collate_range_cmp(c, test) <= 0 - && __collate_range_cmp(test, c2) <= 0 - ) + if ((!__get_current_collate_locale ()->lcid) ? #else if (table->__collate_load_error ? +#endif c <= test && test <= c2 : - __collate_range_cmp(table, c, test) <= 0 - && __collate_range_cmp(table, test, c2) <= 0 + __wcollate_range_cmp(c, test) <= 0 + && __wcollate_range_cmp(test, c2) <= 0 ) -#endif ok = 1; } else if (c == test) ok = 1; |