mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Update from Gnulib by running admin/merge-gnulib
* lib/dirent-private.h, m4/codeset.m4, m4/locale-fr.m4, m4/musl.m4: New files, from Gnulib.
This commit is contained in:
parent
e7dc30c1d5
commit
b77d357ea3
79 changed files with 1472 additions and 465 deletions
14
lib/strtol.c
14
lib/strtol.c
|
|
@ -288,6 +288,11 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
|||
s += 2;
|
||||
base = 16;
|
||||
}
|
||||
else if ((base == 0 || base == 2) && TOUPPER (s[1]) == L_('B'))
|
||||
{
|
||||
s += 2;
|
||||
base = 2;
|
||||
}
|
||||
else if (base == 0)
|
||||
base = 8;
|
||||
}
|
||||
|
|
@ -378,11 +383,14 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
|||
noconv:
|
||||
/* We must handle a special case here: the base is 0 or 16 and the
|
||||
first two characters are '0' and 'x', but the rest are no
|
||||
hexadecimal digits. This is no error case. We return 0 and
|
||||
ENDPTR points to the 'x'. */
|
||||
hexadecimal digits. Likewise when the base is 0 or 2 and the
|
||||
first two characters are '0' and 'b', but the rest are no binary
|
||||
digits. This is no error case. We return 0 and ENDPTR points to
|
||||
the 'x' or 'b'. */
|
||||
if (endptr != NULL)
|
||||
{
|
||||
if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
|
||||
if (save - nptr >= 2
|
||||
&& (TOUPPER (save[-1]) == L_('X') || TOUPPER (save[-1]) == L_('B'))
|
||||
&& save[-2] == L_('0'))
|
||||
*endptr = (STRING_TYPE *) &save[-1];
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue