1 --- wcstoimax.c.orig 2009-11-09 15:05:25.000000000 -0800
2 +++ wcstoimax.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/wcstoimax.c,v 1.3 2007/01/09 00:28:01 imp Exp $");
7 +#include "xlocale_private.h"
12 @@ -46,8 +48,8 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/
13 * Convert a wide character string to an intmax_t integer.
16 -wcstoimax(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
18 +wcstoimax_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
19 + int base, locale_t loc)
23 @@ -55,13 +57,14 @@ wcstoimax(const wchar_t * __restrict npt
27 + NORMALIZE_LOCALE(loc);
29 * See strtoimax for comments as to the logic used.
34 - } while (iswspace(c));
35 + } while (iswspace_l(c, loc));
39 @@ -88,8 +91,8 @@ wcstoimax(const wchar_t * __restrict npt
45 + if (iswdigit_l(c, loc))
46 + c = digittoint_l(c, loc);
49 if (c >= L'0' && c <= L'9')
50 @@ -122,3 +125,10 @@ noconv:
51 *endptr = (wchar_t *)(any ? s - 1 : nptr);
56 +wcstoimax(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
59 + return wcstoimax_l(nptr, endptr, base, __current_locale());