1 --- strtoll.c.bsdnew 2009-11-13 14:11:51.000000000 -0800
2 +++ strtoll.c 2009-11-13 14:11:51.000000000 -0800
3 @@ -33,6 +33,8 @@ static char sccsid[] = "@(#)strtoq.c 8.1
5 __FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoll.c,v 1.22 2007/01/09 00:28:10 imp Exp $");
7 +#include "xlocale_private.h"
12 @@ -45,7 +47,8 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/
13 * alphabets and digits are each contiguous.
16 -strtoll(const char * __restrict nptr, char ** __restrict endptr, int base)
17 +strtoll_l(const char * __restrict nptr, char ** __restrict endptr, int base,
21 unsigned long long acc;
22 @@ -53,6 +56,7 @@ strtoll(const char * __restrict nptr, ch
23 unsigned long long cutoff;
26 + NORMALIZE_LOCALE(loc);
28 * Skip white space and pick up leading +/- sign if any.
29 * If base is 0, allow 0x for hex and 0 for octal, else
30 @@ -61,7 +65,7 @@ strtoll(const char * __restrict nptr, ch
34 - } while (isspace((unsigned char)c));
35 + } while (isspace_l((unsigned char)c, loc));
39 @@ -138,3 +142,9 @@ noconv:
40 *endptr = (char *)(any ? s - 1 : nptr);
45 +strtoll(const char * __restrict nptr, char ** __restrict endptr, int base)
47 + return strtoll_l(nptr, endptr, base, __current_locale());