diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-08-17 07:51:36 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-08-17 07:51:36 +0000 |
commit | 6293b80374f7c7b017515b9a8716a9ea16eb063a (patch) | |
tree | e2c8c00c351a5da2e44e534f298c65901e085303 /posix | |
parent | 51028f34ceeb7c4c91abc2ac2b818afeaa671b91 (diff) | |
download | glibc-6293b80374f7c7b017515b9a8716a9ea16eb063a.zip glibc-6293b80374f7c7b017515b9a8716a9ea16eb063a.tar.gz glibc-6293b80374f7c7b017515b9a8716a9ea16eb063a.tar.bz2 |
Update.
2001-08-17 Ulrich Drepper <drepper@redhat.com>
* sunrpc/svc_simple.c (universal): Use __write instead of write.
* wcsmbs/wcscoll.c: Also define __wcscoll.
* include/wchar.h: Declare __wcscoll.
* libio/fwprintf.c: Use __vfwprintf instead of vfwprintf.
* libio/vwprintf.c: Likewise.
* libio/wprintf.c: Likewise.
* iconv/gconv_cache.c: Use __munmap instead of munmap.
* posix/regex.c [_LIBC] (convert_mbs_to_wcs): Use __mbrtowc
instead of mbrtowc.
[_LIBC]: Use __iswctype instead of iswctype, __wcslen instead of
wcslen, and __wcscoll instead of wcscoll.
* sysdeps/unix/sockatmark.c (sockatmark): Use __ioctl instead of ioctl.
* sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue): Use
__getuid instead of getuid.
* stdio-common/perror.c (perror): Use __close instead of close.
* iconv/gconv_cache.c (__gconv_load_cache): Likewise.
* libio/freopen.c (freopen): Likewise.
* libio/freopen64.c (freopen64): Likewise.
Diffstat (limited to 'posix')
-rw-r--r-- | posix/regex.c | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/posix/regex.c b/posix/regex.c index ee38fdf..5424f04 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -1284,7 +1284,11 @@ convert_mbs_to_wcs (dest, src, len, offset_buffer, is_binary) for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed, psrc += consumed) { +#ifdef _LIBC + consumed = __mbrtowc (pdest, psrc, mb_remain, &mbs); +#else consumed = mbrtowc (pdest, psrc, mb_remain, &mbs); +#endif if (consumed <= 0) /* failed to convert. maybe src contains binary data. @@ -6333,8 +6337,13 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, & ~(uintptr_t)(__alignof__(wctype_t) - 1); wctype = *((wctype_t*)alignedp); workp += CHAR_CLASS_SIZE; +# ifdef _LIBC + if (__iswctype((wint_t)c, wctype)) + goto char_set_matched; +# else if (iswctype((wint_t)c, wctype)) goto char_set_matched; +# endif } /* match with collating_symbol? */ @@ -6370,12 +6379,16 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, for (workp2 = workp + coll_symbol_length ; workp < workp2 ;) { const CHAR_T *backup_d = d, *backup_dend = dend; - length = wcslen(workp); +# ifdef _LIBC + length = __wcslen (workp); +# else + length = wcslen (workp); +# endif /* If wcscoll(the collating symbol, whole string) > 0, any substring of the string never match with the collating symbol. */ - if (wcscoll(workp, d) > 0) + if (__wcscoll (workp, d) > 0) { workp += length + 1; continue; @@ -6400,7 +6413,11 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, str_buf[i] = TRANSLATE(*d); str_buf[i+1] = '\0'; - match = wcscoll(workp, str_buf); +# ifdef _LIBC + match = __wcscoll (workp, str_buf); +# else + match = wcscoll (workp, str_buf); +# endif if (match == 0) goto char_set_matched; @@ -6511,12 +6528,20 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, for (workp2 = workp + equiv_class_length ; workp < workp2 ;) { const CHAR_T *backup_d = d, *backup_dend = dend; - length = wcslen(workp); +# ifdef _LIBC + length = __wcslen (workp); +# else + length = wcslen (workp); +# endif /* If wcscoll(the collating symbol, whole string) > 0, any substring of the string never match with the collating symbol. */ - if (wcscoll(workp, d) > 0) +# ifdef _LIBC + if (__wcscoll (workp, d) > 0) +# else + if (wcscoll (workp, d) > 0) +# endif { workp += length + 1; break; @@ -6541,7 +6566,11 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, str_buf[i] = TRANSLATE(*d); str_buf[i+1] = '\0'; - match = wcscoll(workp, str_buf); +# ifdef _LIBC + match = __wcscoll (workp, str_buf); +# else + match = wcscoll (workp, str_buf); +# endif if (match == 0) goto char_set_matched; @@ -6564,7 +6593,7 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, } /* match with char_range? */ -#ifdef _LIBC +# ifdef _LIBC if (nrules != 0) { uint32_t collseqval; @@ -6587,7 +6616,7 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, } } else -#endif +# endif { /* We set range_start_char at str_buf[0], range_end_char at str_buf[4], and compared char at str_buf[2]. */ @@ -6623,9 +6652,13 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, range_end_char = str_buf + 4; } - if (wcscoll(range_start_char, str_buf+2) <= 0 && - wcscoll(str_buf+2, range_end_char) <= 0) - +# ifdef _LIBC + if (__wcscoll (range_start_char, str_buf+2) <= 0 + && __wcscoll (str_buf+2, range_end_char) <= 0) +# else + if (wcscoll (range_start_char, str_buf+2) <= 0 + && wcscoll (str_buf+2, range_end_char) <= 0) +# endif goto char_set_matched; } } |