aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--posix/regcomp.c4
-rw-r--r--posix/regex_internal.c18
-rw-r--r--posix/regex_internal.h1
4 files changed, 19 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 25953f281e..03d50cf76f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-31 Paolo Bonzini <bonzini@gnu.org>
+
+ * posix/regcomp.c (re_compile_fastmap_iter): Use __mbrtowc.
+ * posix/regex_internal.c (build_wcs_buffer, build_wcs_upper_buffer,
+ re_string_skip_chars, re_string_reconstruct): Likewise.
+ * posix/regex_internal.h [!_LIBC] (__mbrtowc): New #define.
+
2008-12-31 Rafael Avila de Espindola <espindola@google.com>
* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Check and
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 8ba7668e8b..d5a0535e9a 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -327,8 +327,8 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
&& dfa->nodes[node].mb_partial)
*p++ = dfa->nodes[node].opr.c;
memset (&state, '\0', sizeof (state));
- if (mbrtowc (&wc, (const char *) buf, p - buf,
- &state) == p - buf
+ if (__mbrtowc (&wc, (const char *) buf, p - buf,
+ &state) == p - buf
&& (__wcrtomb ((char *) buf, towlower (wc), &state)
!= (size_t) -1))
re_set_fastmap (fastmap, 0, buf[0]);
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 01a432e801..c9da2b961c 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -229,7 +229,7 @@ build_wcs_buffer (re_string_t *pstr)
}
else
p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx;
- mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+ mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
if (BE (mbclen == (size_t) -2, 0))
{
/* The buffer doesn't have enough space, finish to build. */
@@ -299,9 +299,9 @@ build_wcs_upper_buffer (re_string_t *pstr)
remain_len = end_idx - byte_idx;
prev_st = pstr->cur_state;
- mbclen = mbrtowc (&wc,
- ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
- + byte_idx), remain_len, &pstr->cur_state);
+ mbclen = __mbrtowc (&wc,
+ ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
+ + byte_idx), remain_len, &pstr->cur_state);
if (BE (mbclen + 2 > 2, 1))
{
wchar_t wcu = wc;
@@ -369,7 +369,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
}
else
p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
- mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+ mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
if (BE (mbclen + 2 > 2, 1))
{
wchar_t wcu = wc;
@@ -491,8 +491,8 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc)
int remain_len;
remain_len = pstr->len - rawbuf_idx;
prev_st = pstr->cur_state;
- mbclen = mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx,
- remain_len, &pstr->cur_state);
+ mbclen = __mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx,
+ remain_len, &pstr->cur_state);
if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0))
{
/* We treat these cases as a single byte character. */
@@ -734,8 +734,8 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
/* XXX Don't use mbrtowc, we know which conversion
to use (UTF-8 -> UCS4). */
memset (&cur_state, 0, sizeof (cur_state));
- mbclen = mbrtowc (&wc2, (const char *) p, mlen,
- &cur_state);
+ mbclen = __mbrtowc (&wc2, (const char *) p, mlen,
+ &cur_state);
if (raw + offset - p <= mbclen
&& mbclen < (size_t) -2)
{
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 79266781b8..65a9905860 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -116,6 +116,7 @@
# define __wctype wctype
# define __iswctype iswctype
# define __btowc btowc
+# define __mbrtowc mbrtowc
# define __mempcpy mempcpy
# define __wcrtomb wcrtomb
# define __regfree regfree