From 9de4e2034072a876f16d9c1d7368cee533d91a6b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 26 Jan 2000 02:20:01 +0000 Subject: Update. 2000-01-24 Paul Eggert * posix/fnmatch_loop.c (FCT): Use locale's collating sequence when deciding whether a character falls within a character range. 2000-01-24 Paul Eggert * posix/fnmatch_loop.c (FCT): When matching [A-Z] and folding case, lower-case A too. 2000-01-24 Thorsten Kukuk * sysdeps/unix/sysv/linux/i386/syscalls.list: Remove old[gs]etrlimit. --- posix/fnmatch_loop.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'posix') diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c index a7fcac7c80..bfcdde6005 100644 --- a/posix/fnmatch_loop.c +++ b/posix/fnmatch_loop.c @@ -247,8 +247,9 @@ FCT (pattern, string, no_leading_period, flags) return FNM_NOMATCH; else { + c = FOLD (c); normal_bracket: - if (FOLD (c) == fn) + if (c == fn) goto matched; cold = c; @@ -257,14 +258,26 @@ FCT (pattern, string, no_leading_period, flags) if (c == L('-') && *p != L(']')) { /* It is a range. */ + CHAR lo[2]; + CHAR fc[2]; UCHAR cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == L('\\')) cend = *p++; if (cend == L('\0')) return FNM_NOMATCH; - if (cold <= fn && fn <= FOLD (cend)) - goto matched; + lo[0] = cold; + lo[1] = L('\0'); + fc[0] = fn; + fc[1] = L('\0'); + if (STRCOLL (lo, fc) <= 0) + { + CHAR hi[2]; + hi[0] = FOLD (cend); + hi[1] = L('\0'); + if (STRCOLL (fc, hi) <= 0) + goto matched; + } c = *p++; } -- cgit v1.2.3