-# $Id: srclist.txt,v 1.96 2005-09-01 19:41:07 eggert Exp $
+# $Id: srclist.txt,v 1.97 2005-09-01 21:01:27 eggert Exp $
# Files for which we are not the source. See ./srclistvars.sh for the
# variable definitions.
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1282
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1284
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1285
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1286
#$LIBCSRC/posix/regex_internal.c lib gpl
#
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054
2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
+ * regex_internal.c (build_wcs_upper_buffer): Fix portability
+ bugs in int versus size_t comparisons.
+
Use bool where appropriate.
* regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
All callers changed.
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))
+ if (BE ((size_t) (mbclen + 2) > 2, 1))
{
wchar_t wcu = wc;
if (iswlower (wc))
else
p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state);
- if (BE (mbclen + 2 > 2, 1))
+ if (BE ((size_t) (mbclen + 2) > 2, 1))
{
wchar_t wcu = wc;
if (iswlower (wc))
wchar_t wc2;
Idx mlen = raw + pstr->len - p;
unsigned char buf[6];
+ size_t mbclen;
q = p;
if (BE (pstr->trans != NULL, 0))
/* XXX Don't use mbrtowc, we know which conversion
to use (UTF-8 -> UCS4). */
memset (&cur_state, 0, sizeof (cur_state));
- mlen = (mbrtowc (&wc2, (const char *) p, mlen,
- &cur_state)
- - (raw + offset - p));
- if (mlen >= 0)
+ mbclen = mbrtowc (&wc2, (const char *) p, mlen,
+ &cur_state);
+ if (raw + offset - p <= mbclen && mbclen < (size_t) -2)
{
memset (&pstr->cur_state, '\0',
sizeof (mbstate_t));
- pstr->valid_len = mlen;
+ pstr->valid_len = mbclen - (raw + offset - p);
wc = wc2;
}
break;