]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/runetype.c.patch
Libc-763.12.tar.gz
[apple/libc.git] / locale / FreeBSD / runetype.c.patch
1 --- runetype.c.bsdnew 2009-11-09 15:05:25.000000000 -0800
2 +++ runetype.c 2009-11-09 16:54:21.000000000 -0800
3 @@ -33,20 +33,24 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/locale/runetype.c,v 1.14 2007/01/09 00:28:00 imp Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <ctype.h>
10 #include <stdio.h>
11 #include <runetype.h>
12
13 unsigned long
14 -___runetype(__ct_rune_t c)
15 +___runetype_l(__ct_rune_t c, locale_t loc)
16 {
17 size_t lim;
18 - _RuneRange *rr = &_CurrentRuneLocale->__runetype_ext;
19 + _RuneRange *rr;
20 _RuneEntry *base, *re;
21
22 if (c < 0 || c == EOF)
23 return(0L);
24
25 + NORMALIZE_LOCALE(loc);
26 + rr = &loc->__lc_ctype->_CurrentRuneLocale.__runetype_ext;
27 /* Binary search -- see bsearch.c for explanation. */
28 base = rr->__ranges;
29 for (lim = rr->__nranges; lim != 0; lim >>= 1) {
30 @@ -64,3 +68,9 @@ ___runetype(__ct_rune_t c)
31
32 return(0L);
33 }
34 +
35 +unsigned long
36 +___runetype(__ct_rune_t c)
37 +{
38 + return ___runetype_l(c, __current_locale());
39 +}