1 --- wcstof.c.orig Thu Nov 25 11:38:20 2004
2 +++ wcstof.c Fri Feb 18 14:48:11 2005
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wcstof.c,v 1.3 2004/04/07 09:47:56 tjr Exp $");
7 +#include "xlocale_private.h"
13 * See wcstod() for comments as to the logic used.
16 -wcstof(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr)
17 +wcstof_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))
33 - if ((len = wcsrtombs(NULL, &wcp, 0, &mbs)) == (size_t)-1) {
34 + if ((len = wcsrtombs_l(NULL, &wcp, 0, &mbs, loc)) == (size_t)-1) {
36 *endptr = (wchar_t *)nptr;
39 if ((buf = malloc(len + 1)) == NULL)
42 - wcsrtombs(buf, &wcp, len + 1, &mbs);
43 + wcsrtombs_l(buf, &wcp, len + 1, &mbs, loc);
45 - val = strtof(buf, &end);
46 + val = strtof_l(buf, &end, loc);
49 *endptr = (wchar_t *)nptr + (end - buf);
57 +wcstof(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr)
59 + return wcstof_l(nptr, endptr, __current_locale());