]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/scanf.c.patch
1462320dedeb08469f24075e5858b74bd5a0f7e6
[apple/libc.git] / stdio / FreeBSD / scanf.c.patch
1 --- scanf.c.bsdnew 2009-11-11 13:33:15.000000000 -0800
2 +++ scanf.c 2009-11-11 13:33:15.000000000 -0800
3 @@ -36,6 +36,8 @@ static char sccsid[] = "@(#)scanf.c 8.1
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/scanf.c,v 1.13 2007/01/09 00:28:07 imp Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include "namespace.h"
10 #include <stdio.h>
11 #include <stdarg.h>
12 @@ -51,7 +53,22 @@ scanf(char const * __restrict fmt, ...)
13
14 va_start(ap, fmt);
15 FLOCKFILE(stdin);
16 - ret = __svfscanf(stdin, fmt, ap);
17 + ret = __svfscanf_l(stdin, __current_locale(), fmt, ap);
18 + FUNLOCKFILE(stdin);
19 + va_end(ap);
20 + return (ret);
21 +}
22 +
23 +int
24 +scanf_l(locale_t loc, char const * __restrict fmt, ...)
25 +{
26 + int ret;
27 + va_list ap;
28 +
29 + NORMALIZE_LOCALE(loc);
30 + va_start(ap, fmt);
31 + FLOCKFILE(stdin);
32 + ret = __svfscanf_l(stdin, loc, fmt, ap);
33 FUNLOCKFILE(stdin);
34 va_end(ap);
35 return (ret);