1 --- mblen.c.orig Thu Nov 25 11:38:18 2004
2 +++ mblen.c Fri Feb 18 16:55:20 2005
5 __FBSDID("$FreeBSD: src/lib/libc/locale/mblen.c,v 1.9 2004/07/29 06:18:40 tjr Exp $");
7 +#include "xlocale_private.h"
14 -mblen(const char *s, size_t n)
15 +mblen_l(const char *s, size_t n, locale_t loc)
17 static const mbstate_t initial;
18 - static mbstate_t mbs;
21 + NORMALIZE_LOCALE(loc);
23 /* No support for state dependent encodings. */
25 + loc->__mbs_mblen = initial;
28 - rval = __mbrtowc(NULL, s, n, &mbs);
29 + rval = loc->__lc_ctype->__mbrtowc(NULL, s, n, &loc->__mbs_mblen, loc);
30 if (rval == (size_t)-1 || rval == (size_t)-2)
36 +mblen(const char *s, size_t n)
38 + return mblen_l(s, n, __current_locale());