From acb5ee2e561276d64c6e26ef4b82f59a4db5ae90 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 24 May 2000 20:22:51 +0000 Subject: Update. 2000-05-24 Ulrich Drepper * locale/programs/ld-collate.c (struct element_t): Add mbseqorder and wcseqorder members. (struct locale_collate_t): Likewise. (collate_finish): Assign collation sequence value to each character. Create tables for output. (collate_output): Write out tables with collation sequence information. * locale/C-collate.c: Provide C locale data for collation sequence table. * locale/langinfo.h: Add _NL_COLLATE_COLLSEQMB and _NL_COLLATE_COLLSEQWC. * locale/categories.def: Add entries for _NL_COLLATE_COLLSEQMB and _NL_COLLATE_COLLSEQWC. * posix/fnmatch.c: Define SUFFIX and WIDE_CHAR_VERSION before include fnmatch_loop.c. * posix/fnmatch_loop.c: Don't use strcoll while determining whether character is matched by range expression. Use collation sequence table. Outside glibc fall back on simple character value comparison. --- posix/fnmatch.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'posix/fnmatch.c') diff --git a/posix/fnmatch.c b/posix/fnmatch.c index 18abf5da27..c4b11080fe 100644 --- a/posix/fnmatch.c +++ b/posix/fnmatch.c @@ -48,6 +48,15 @@ # include #endif +/* We need some of the locale data (the collation sequence information) + but there is no interface to get this information in general. Therefore + we support a correct implementation only in glibc. */ +#ifdef _LIBC +# include "../locale/localeinfo.h" + +# define CONCAT(a,b) __CONCAT(a,b) +#endif + /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling @@ -192,6 +201,7 @@ __wcschrnul (s, c) # define STRCHR(S, C) strchr (S, C) # define STRCHRNUL(S, C) __strchrnul (S, C) # define STRCOLL(S1, S2) strcoll (S1, S2) +# define SUFFIX MB # include "fnmatch_loop.c" @@ -209,7 +219,10 @@ __wcschrnul (s, c) # define BTOWC(C) (C) # define STRCHR(S, C) wcschr (S, C) # define STRCHRNUL(S, C) __wcschrnul (S, C) -# define STRCOLL(S1, S2) wcscoll (S1, S2) +# define STRCOLL(S1, S2) wcscoll (S1, S2) +# define SUFFIX WC +# define WIDE_CHAR_VERSION 1 + # undef IS_CHAR_CLASS # ifdef _LIBC -- cgit v1.2.3