aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-02 00:09:25 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-02 00:09:25 +0000
commit8fb81470d9466b7e3d60cbfd6fc2d04fd1aae78a (patch)
treef8046bf51bce4125faaa2bfe115d8e0d026e57b8 /posix
parent925e31d9c22c5cdf1d80d9a5683523efc729cfd1 (diff)
downloadglibc-8fb81470d9466b7e3d60cbfd6fc2d04fd1aae78a.tar
glibc-8fb81470d9466b7e3d60cbfd6fc2d04fd1aae78a.tar.gz
glibc-8fb81470d9466b7e3d60cbfd6fc2d04fd1aae78a.tar.bz2
glibc-8fb81470d9466b7e3d60cbfd6fc2d04fd1aae78a.zip
Update.
* gnulib/Makefile (tests): Add tst-gcc. * gnulib/tst-gcc.c: New file. * assert/Makefile (routines): Add __assert. * assert/Versions: Export __assert for glibc 2.2. * assert/__assert.c: New file. * assert/assert.h: Declare __assert. 2000-07-27 Bruno Haible <haible@clisp.cons.org> * locale/localeinfo.h (_ISCTYPE): New macro. * posix/fnmatch_loop.c (internal_fnmatch): Use it, support new LC_CTYPE locale format. * locale/programs/ld-ctype.c (locale_ctype_t): New field class_b. (ctype_output): Output class_b[nr] right before class_3level[nr]. (allocate_arrays): Fill class_b, similarly to class_3level. 2000-08-01 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'posix')
-rw-r--r--posix/fnmatch_loop.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
index 38cb8f1d76..86526a15ff 100644
--- a/posix/fnmatch_loop.c
+++ b/posix/fnmatch_loop.c
@@ -256,35 +256,41 @@ FCT (pattern, string, no_leading_period, flags)
/* Invalid character class name. */
return FNM_NOMATCH;
- /* The following code is glibc specific but does
- there a good job in sppeding up the code since
- we can avoid the btowc() call. The
- IS_CHAR_CLASS call will return a bit mask for
- the 32-bit table. We have to convert it to a
- bitmask for the __ctype_b table. This has to
- be done based on the byteorder as can be seen
- below. In any case we will fall back on the
- code using btowc() if the class is not one of
- the standard classes. */
# if defined _LIBC && ! WIDE_CHAR_VERSION
-# if __BYTE_ORDER == __LITTLE_ENDIAN
- if ((wt & 0xf0ffff) == 0)
+ /* The following code is glibc specific but does
+ there a good job in speeding up the code since
+ we can avoid the btowc() call. */
+ if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
{
- wt >>= 16;
- if ((__ctype_b[(UCHAR) *n] & wt) != 0)
- goto matched;
- }
+ /* Old locale format. */
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ if ((wt & 0xf0ffff) == 0)
+ {
+ wt >>= 16;
+ if ((__ctype_b[(UCHAR) *n] & wt) != 0)
+ goto matched;
+ }
# else
- if (wt <= 0x800)
+ if (wt <= 0x800)
+ {
+ if ((__ctype_b[(UCHAR) *n] & wt) != 0)
+ goto matched;
+ }
+# endif
+ else
+ if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
+ goto matched;
+ }
+ else
{
- if ((__ctype_b[(UCHAR) *n] & wt) != 0)
+ /* New locale format. */
+ if (_ISCTYPE ((UCHAR) *n, wt))
goto matched;
}
-# endif
- else
+# else
+ if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
+ goto matched;
# endif
- if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
- goto matched;
#else
if ((STREQ (str, L("alnum")) && ISALNUM ((UCHAR) *n))
|| (STREQ (str, L("alpha")) && ISALPHA ((UCHAR) *n))