mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 10:50:07 +00:00
Update.
2001-11-26 Ulrich Drepper <drepper@redhat.com> * stdio-common/vfscanf.c: If incomplete nan of inf(inity) strings are found call conv_error and not input_error [PR libc/2669]. * math/bits/mathcalls.h: Mark ceil and floor as const. Reported by David Mosberger. 2001-11-21 Jim Meyering <meyering@lucent.com> * posix/regex.c (iswctype, mbrtowc, wcslen, wcscoll, wcrtomb) [_LIBC]: Define to be __-prefixed. Remove unnecessary duplication in `#ifdef _LIBC' blocks.
This commit is contained in:
parent
05957bbd90
commit
f4efd06825
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2001-11-26 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* stdio-common/vfscanf.c: If incomplete nan of inf(inity) strings
|
||||||
|
are found call conv_error and not input_error [PR libc/2669].
|
||||||
|
|
||||||
|
* math/bits/mathcalls.h: Mark ceil and floor as const.
|
||||||
|
Reported by David Mosberger.
|
||||||
|
|
||||||
|
2001-11-21 Jim Meyering <meyering@lucent.com>
|
||||||
|
|
||||||
|
* posix/regex.c (iswctype, mbrtowc, wcslen, wcscoll, wcrtomb) [_LIBC]:
|
||||||
|
Define to be __-prefixed.
|
||||||
|
Remove unnecessary duplication in `#ifdef _LIBC' blocks.
|
||||||
|
|
||||||
2001-11-26 Andreas Jaeger <aj@suse.de>
|
2001-11-26 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/hppa/brk.c: Remove __brk_addr alias,
|
* sysdeps/unix/sysv/linux/hppa/brk.c: Remove __brk_addr alias,
|
||||||
|
@ -1383,9 +1383,10 @@ If @var{c} is @code{EOF}, @code{ungetc} does nothing and just returns
|
|||||||
The character that you push back doesn't have to be the same as the last
|
The character that you push back doesn't have to be the same as the last
|
||||||
character that was actually read from the stream. In fact, it isn't
|
character that was actually read from the stream. In fact, it isn't
|
||||||
necessary to actually read any characters from the stream before
|
necessary to actually read any characters from the stream before
|
||||||
unreading them with @code{ungetc}! But that is a strange way to write
|
unreading them with @code{ungetc}! But that is a strange way to write a
|
||||||
a program; usually @code{ungetc} is used only to unread a character
|
program; usually @code{ungetc} is used only to unread a character that
|
||||||
that was just read from the same stream.
|
was just read from the same stream. The GNU C library supports this
|
||||||
|
even on files opened in binary mode, but other systems might not.
|
||||||
|
|
||||||
The GNU C library only supports one character of pushback---in other
|
The GNU C library only supports one character of pushback---in other
|
||||||
words, it does not work to call @code{ungetc} twice without doing input
|
words, it does not work to call @code{ungetc} twice without doing input
|
||||||
|
@ -159,13 +159,13 @@ __MATHCALL (cbrt,, (_Mdouble_ __x));
|
|||||||
/* Nearest integer, absolute value, and remainder functions. */
|
/* Nearest integer, absolute value, and remainder functions. */
|
||||||
|
|
||||||
/* Smallest integral value not less than X. */
|
/* Smallest integral value not less than X. */
|
||||||
__MATHCALL (ceil,, (_Mdouble_ __x));
|
__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
|
||||||
|
|
||||||
/* Absolute value of X. */
|
/* Absolute value of X. */
|
||||||
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
|
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
|
||||||
|
|
||||||
/* Largest integer not greater than X. */
|
/* Largest integer not greater than X. */
|
||||||
__MATHCALL (floor,, (_Mdouble_ __x));
|
__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
|
||||||
|
|
||||||
/* Floating-point modulo remainder of X/Y. */
|
/* Floating-point modulo remainder of X/Y. */
|
||||||
__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
|
__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||||
|
@ -82,6 +82,11 @@
|
|||||||
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
|
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
|
||||||
|
|
||||||
# define btowc __btowc
|
# define btowc __btowc
|
||||||
|
# define iswctype __iswctype
|
||||||
|
# define mbrtowc __mbrtowc
|
||||||
|
# define wcslen __wcslen
|
||||||
|
# define wcscoll __wcscoll
|
||||||
|
# define wcrtomb __wcrtomb
|
||||||
|
|
||||||
/* We are also using some library internals. */
|
/* We are also using some library internals. */
|
||||||
# include <locale/localeinfo.h>
|
# include <locale/localeinfo.h>
|
||||||
@ -1284,11 +1289,7 @@ convert_mbs_to_wcs (dest, src, len, offset_buffer, is_binary)
|
|||||||
for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed,
|
for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed,
|
||||||
psrc += consumed)
|
psrc += consumed)
|
||||||
{
|
{
|
||||||
#ifdef _LIBC
|
|
||||||
consumed = __mbrtowc (pdest, psrc, mb_remain, &mbs);
|
|
||||||
#else
|
|
||||||
consumed = mbrtowc (pdest, psrc, mb_remain, &mbs);
|
consumed = mbrtowc (pdest, psrc, mb_remain, &mbs);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (consumed <= 0)
|
if (consumed <= 0)
|
||||||
/* failed to convert. maybe src contains binary data.
|
/* failed to convert. maybe src contains binary data.
|
||||||
@ -3309,13 +3310,8 @@ PREFIX(regex_compile) (ARG_PREFIX(pattern), ARG_PREFIX(size), syntax, bufp)
|
|||||||
|
|
||||||
for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
|
for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
|
||||||
{
|
{
|
||||||
# ifdef _LIBC
|
|
||||||
if (__iswctype (__btowc (ch), wt))
|
|
||||||
SET_LIST_BIT (ch);
|
|
||||||
# else
|
|
||||||
if (iswctype (btowc (ch), wt))
|
if (iswctype (btowc (ch), wt))
|
||||||
SET_LIST_BIT (ch);
|
SET_LIST_BIT (ch);
|
||||||
# endif
|
|
||||||
|
|
||||||
if (translate && (is_upper || is_lower)
|
if (translate && (is_upper || is_lower)
|
||||||
&& (ISUPPER (ch) || ISLOWER (ch)))
|
&& (ISUPPER (ch) || ISLOWER (ch)))
|
||||||
@ -4631,11 +4627,7 @@ truncate_wchar (c)
|
|||||||
mbstate_t state;
|
mbstate_t state;
|
||||||
int retval;
|
int retval;
|
||||||
memset (&state, '\0', sizeof (state));
|
memset (&state, '\0', sizeof (state));
|
||||||
# ifdef _LIBC
|
|
||||||
retval = __wcrtomb (buf, c, &state);
|
|
||||||
# else
|
|
||||||
retval = wcrtomb (buf, c, &state);
|
retval = wcrtomb (buf, c, &state);
|
||||||
# endif
|
|
||||||
return retval > 0 ? buf[0] : (unsigned char) c;
|
return retval > 0 ? buf[0] : (unsigned char) c;
|
||||||
}
|
}
|
||||||
#endif /* WCHAR */
|
#endif /* WCHAR */
|
||||||
@ -6435,13 +6427,8 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
|
|||||||
& ~(uintptr_t)(__alignof__(wctype_t) - 1);
|
& ~(uintptr_t)(__alignof__(wctype_t) - 1);
|
||||||
wctype = *((wctype_t*)alignedp);
|
wctype = *((wctype_t*)alignedp);
|
||||||
workp += CHAR_CLASS_SIZE;
|
workp += CHAR_CLASS_SIZE;
|
||||||
# ifdef _LIBC
|
|
||||||
if (__iswctype((wint_t)c, wctype))
|
|
||||||
goto char_set_matched;
|
|
||||||
# else
|
|
||||||
if (iswctype((wint_t)c, wctype))
|
if (iswctype((wint_t)c, wctype))
|
||||||
goto char_set_matched;
|
goto char_set_matched;
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* match with collating_symbol? */
|
/* match with collating_symbol? */
|
||||||
@ -6477,20 +6464,12 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
|
|||||||
for (workp2 = workp + coll_symbol_length ; workp < workp2 ;)
|
for (workp2 = workp + coll_symbol_length ; workp < workp2 ;)
|
||||||
{
|
{
|
||||||
const CHAR_T *backup_d = d, *backup_dend = dend;
|
const CHAR_T *backup_d = d, *backup_dend = dend;
|
||||||
# ifdef _LIBC
|
|
||||||
length = __wcslen (workp);
|
|
||||||
# else
|
|
||||||
length = wcslen (workp);
|
length = wcslen (workp);
|
||||||
# endif
|
|
||||||
|
|
||||||
/* If wcscoll(the collating symbol, whole string) > 0,
|
/* If wcscoll(the collating symbol, whole string) > 0,
|
||||||
any substring of the string never match with the
|
any substring of the string never match with the
|
||||||
collating symbol. */
|
collating symbol. */
|
||||||
# ifdef _LIBC
|
|
||||||
if (__wcscoll (workp, d) > 0)
|
|
||||||
# else
|
|
||||||
if (wcscoll (workp, d) > 0)
|
if (wcscoll (workp, d) > 0)
|
||||||
# endif
|
|
||||||
{
|
{
|
||||||
workp += length + 1;
|
workp += length + 1;
|
||||||
continue;
|
continue;
|
||||||
@ -6515,11 +6494,7 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
|
|||||||
str_buf[i] = TRANSLATE(*d);
|
str_buf[i] = TRANSLATE(*d);
|
||||||
str_buf[i+1] = '\0';
|
str_buf[i+1] = '\0';
|
||||||
|
|
||||||
# ifdef _LIBC
|
|
||||||
match = __wcscoll (workp, str_buf);
|
|
||||||
# else
|
|
||||||
match = wcscoll (workp, str_buf);
|
match = wcscoll (workp, str_buf);
|
||||||
# endif
|
|
||||||
if (match == 0)
|
if (match == 0)
|
||||||
goto char_set_matched;
|
goto char_set_matched;
|
||||||
|
|
||||||
@ -6630,20 +6605,12 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
|
|||||||
for (workp2 = workp + equiv_class_length ; workp < workp2 ;)
|
for (workp2 = workp + equiv_class_length ; workp < workp2 ;)
|
||||||
{
|
{
|
||||||
const CHAR_T *backup_d = d, *backup_dend = dend;
|
const CHAR_T *backup_d = d, *backup_dend = dend;
|
||||||
# ifdef _LIBC
|
|
||||||
length = __wcslen (workp);
|
|
||||||
# else
|
|
||||||
length = wcslen (workp);
|
length = wcslen (workp);
|
||||||
# endif
|
|
||||||
|
|
||||||
/* If wcscoll(the collating symbol, whole string) > 0,
|
/* If wcscoll(the collating symbol, whole string) > 0,
|
||||||
any substring of the string never match with the
|
any substring of the string never match with the
|
||||||
collating symbol. */
|
collating symbol. */
|
||||||
# ifdef _LIBC
|
|
||||||
if (__wcscoll (workp, d) > 0)
|
|
||||||
# else
|
|
||||||
if (wcscoll (workp, d) > 0)
|
if (wcscoll (workp, d) > 0)
|
||||||
# endif
|
|
||||||
{
|
{
|
||||||
workp += length + 1;
|
workp += length + 1;
|
||||||
break;
|
break;
|
||||||
@ -6668,11 +6635,7 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
|
|||||||
str_buf[i] = TRANSLATE(*d);
|
str_buf[i] = TRANSLATE(*d);
|
||||||
str_buf[i+1] = '\0';
|
str_buf[i+1] = '\0';
|
||||||
|
|
||||||
# ifdef _LIBC
|
|
||||||
match = __wcscoll (workp, str_buf);
|
|
||||||
# else
|
|
||||||
match = wcscoll (workp, str_buf);
|
match = wcscoll (workp, str_buf);
|
||||||
# endif
|
|
||||||
|
|
||||||
if (match == 0)
|
if (match == 0)
|
||||||
goto char_set_matched;
|
goto char_set_matched;
|
||||||
@ -6754,13 +6717,8 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
|
|||||||
range_end_char = str_buf + 4;
|
range_end_char = str_buf + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
if (wcscoll (range_start_char, str_buf+2) <= 0
|
||||||
&& wcscoll (str_buf+2, range_end_char) <= 0)
|
&& wcscoll (str_buf+2, range_end_char) <= 0)
|
||||||
# endif
|
|
||||||
goto char_set_matched;
|
goto char_set_matched;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1596,7 +1596,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
|||||||
if (width == 0 || inchar () == EOF)
|
if (width == 0 || inchar () == EOF)
|
||||||
/* EOF is only an input error before we read any chars. */
|
/* EOF is only an input error before we read any chars. */
|
||||||
conv_error ();
|
conv_error ();
|
||||||
if (! ISDIGIT (c) && TOLOWER (c) != L_('i'))
|
if (! ISDIGIT (c) && TOLOWER (c) != L_('i')
|
||||||
|
&& TOLOWER (c) != L_('n'))
|
||||||
{
|
{
|
||||||
#ifdef COMPILE_WSCANF
|
#ifdef COMPILE_WSCANF
|
||||||
if (c != decimal)
|
if (c != decimal)
|
||||||
@ -1654,12 +1655,12 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
|||||||
/* Maybe "nan". */
|
/* Maybe "nan". */
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('a'))
|
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('a'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n'))
|
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
@ -1671,12 +1672,12 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
|||||||
/* Maybe "inf" or "infinity". */
|
/* Maybe "inf" or "infinity". */
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n'))
|
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('f'))
|
if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('f'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
@ -1691,25 +1692,25 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
|||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF
|
if (width == 0 || inchar () == EOF
|
||||||
|| TOLOWER (c) != L_('n'))
|
|| TOLOWER (c) != L_('n'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF
|
if (width == 0 || inchar () == EOF
|
||||||
|| TOLOWER (c) != L_('i'))
|
|| TOLOWER (c) != L_('i'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF
|
if (width == 0 || inchar () == EOF
|
||||||
|| TOLOWER (c) != L_('t'))
|
|| TOLOWER (c) != L_('t'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
if (width == 0 || inchar () == EOF
|
if (width == 0 || inchar () == EOF
|
||||||
|| TOLOWER (c) != L_('y'))
|
|| TOLOWER (c) != L_('y'))
|
||||||
input_error ();
|
conv_error ();
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
--width;
|
--width;
|
||||||
ADDW (c);
|
ADDW (c);
|
||||||
|
Loading…
Reference in New Issue
Block a user