1 --- wcstod.c.orig Thu Nov 25 11:38:20 2004
2 +++ wcstod.c Fri Feb 18 14:45:42 2005
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wcstod.c,v 1.4 2004/04/07 09:47:56 tjr Exp $");
7 +#include "xlocale_private.h"
13 * for at least the digits, radix character and letters.
16 -wcstod(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr)
17 +wcstod_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
20 static const mbstate_t initial;
26 - while (iswspace(*nptr))
27 + NORMALIZE_LOCALE(loc);
28 + while (iswspace_l(*nptr, loc))
36 - if ((len = wcsrtombs(NULL, &wcp, 0, &mbs)) == (size_t)-1) {
37 + if ((len = wcsrtombs_l(NULL, &wcp, 0, &mbs, loc)) == (size_t)-1) {
39 *endptr = (wchar_t *)nptr;
42 if ((buf = malloc(len + 1)) == NULL)
45 - wcsrtombs(buf, &wcp, len + 1, &mbs);
46 + wcsrtombs_l(buf, &wcp, len + 1, &mbs, loc);
48 /* Let strtod() do most of the work for us. */
49 - val = strtod(buf, &end);
50 + val = strtod_l(buf, &end, loc);
53 * We only know where the number ended in the _multibyte_
61 +wcstod(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr)
63 + return wcstod_l(nptr, endptr, __current_locale());