diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-03-19 21:04:10 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-03-19 21:04:10 +0000 |
commit | 8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf (patch) | |
tree | b7091affa76bbaf47e78a59dfc72b2102554eaf9 /posix/regcomp.c | |
parent | f5c3480e830e94e0e51a0bdb1053944daed8bc58 (diff) |
Updated to fedora-glibc-20050319T1907cvs/fedora-glibc-2_3_4-15
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r-- | posix/regcomp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c index a7112cffdd..68e2bdab92 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -359,7 +359,8 @@ re_compile_fastmap_iter (bufp, init_state, fastmap) memset (&state, 0, sizeof (state)); if (mbrtowc (&wc, (const char *) buf, p - buf, &state) == p - buf - && __wcrtomb ((char *) buf, towlower (wc), &state) > 0) + && (__wcrtomb ((char *) buf, towlower (wc), &state) + != (size_t) -1)) re_set_fastmap (fastmap, 0, buf[0]); } #endif @@ -409,12 +410,13 @@ re_compile_fastmap_iter (bufp, init_state, fastmap) char buf[256]; mbstate_t state; memset (&state, '\0', sizeof (state)); - __wcrtomb (buf, cset->mbchars[i], &state); - re_set_fastmap (fastmap, icase, *(unsigned char *) buf); + if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) + re_set_fastmap (fastmap, icase, *(unsigned char *) buf); if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) { - __wcrtomb (buf, towlower (cset->mbchars[i]), &state); - re_set_fastmap (fastmap, 0, *(unsigned char *) buf); + if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) + != (size_t) -1) + re_set_fastmap (fastmap, 0, *(unsigned char *) buf); } } } |