1 --- vasprintf.c.orig 2009-11-30 16:15:30.000000000 -0800
2 +++ vasprintf.c 2009-12-03 15:19:16.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/vasprintf.c,v 1.19 2008/04/17 22:17:54 jhb Exp $");
7 +#include "xlocale_private.h"
15 -vasprintf(str, fmt, ap)
16 +vasprintf_l(str, loc, fmt, ap)
25 + struct __sFILEX ext;
29 + NORMALIZE_LOCALE(loc);
31 f._flags = __SWR | __SSTR | __SALC;
32 f._bf._base = f._p = (unsigned char *)malloc(128);
33 @@ -55,7 +62,7 @@ vasprintf(str, fmt, ap)
34 f._bf._size = f._w = 127; /* Leave room for the NUL */
36 memset(&f._mbstate, 0, sizeof(mbstate_t));
37 - ret = __vfprintf(&f, fmt, ap);
38 + ret = __vfprintf(&f, loc, fmt, ap);
42 @@ -66,3 +73,12 @@ vasprintf(str, fmt, ap)
43 *str = (char *)f._bf._base;
48 +vasprintf(str, fmt, ap)
53 + return vasprintf_l(str, __current_locale(), fmt, ap);