]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/dprintf.c.patch
Libc-763.12.tar.gz
[apple/libc.git] / stdio / FreeBSD / dprintf.c.patch
1 --- dprintf.c.orig 2009-12-15 17:43:05.000000000 -0800
2 +++ dprintf.c 2009-12-15 17:45:32.000000000 -0800
3 @@ -27,7 +27,8 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/dprintf.c,v 1.1 2009/03/04 03:38:51 das Exp $");
6
7 -#define _WITH_DPRINTF
8 +#include "xlocale_private.h"
9 +
10 #include "namespace.h"
11 #include <stdarg.h>
12 #include <stdio.h>
13 @@ -40,7 +41,19 @@ dprintf(int fd, const char * __restrict
14 int ret;
15
16 va_start(ap, fmt);
17 - ret = vdprintf(fd, fmt, ap);
18 + ret = vdprintf_l(fd, __current_locale(), fmt, ap);
19 + va_end(ap);
20 + return (ret);
21 +}
22 +
23 +int
24 +dprintf_l(int fd, locale_t loc, const char * __restrict fmt, ...)
25 +{
26 + va_list ap;
27 + int ret;
28 +
29 + va_start(ap, fmt);
30 + ret = vdprintf_l(fd, loc, fmt, ap);
31 va_end(ap);
32 return (ret);
33 }