1 --- wcstoll.c.orig 2009-11-09 15:05:25.000000000 -0800
2 +++ wcstoll.c 2009-11-09 15:05:26.000000000 -0800
3 @@ -36,6 +36,8 @@ __FBSDID("FreeBSD: src/lib/libc/stdlib/s
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wcstoll.c,v 1.2 2007/01/09 00:28:01 imp Exp $");
7 +#include "xlocale_private.h"
12 @@ -46,7 +48,8 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/
13 * Convert a wide character string to a long long integer.
16 -wcstoll(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base)
17 +wcstoll_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
18 + int base, locale_t loc)
21 unsigned long long acc;
22 @@ -54,13 +57,14 @@ wcstoll(const wchar_t * __restrict nptr,
23 unsigned long long cutoff;
26 + NORMALIZE_LOCALE(loc);
28 * See strtoll for comments as to the logic used.
33 - } while (iswspace(c));
34 + } while (iswspace_l(c, loc));
38 @@ -87,8 +91,8 @@ wcstoll(const wchar_t * __restrict nptr,
44 + if (iswdigit_l(c, loc))
45 + c = digittoint_l(c, loc);
48 if (c >= L'0' && c <= L'9')
49 @@ -121,3 +125,9 @@ noconv:
50 *endptr = (wchar_t *)(any ? s - 1 : nptr);
55 +wcstoll(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base)
57 + return wcstoll_l(nptr, endptr, base, __current_locale());