]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/ldpart.c.patch
Libc-391.4.1.tar.gz
[apple/libc.git] / locale / FreeBSD / ldpart.c.patch
1 --- ldpart.c.orig 2004-11-25 11:38:17.000000000 -0800
2 +++ ldpart.c 2005-02-13 01:59:35.000000000 -0800
3 @@ -27,6 +27,8 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/locale/ldpart.c,v 1.15 2004/04/25 19:56:50 ache Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include "namespace.h"
10 #include <sys/types.h>
11 #include <sys/stat.h>
12 @@ -44,9 +46,9 @@
13
14 static int split_lines(char *, const char *);
15
16 -int
17 +__private_extern__ int
18 __part_load_locale(const char *name,
19 - int *using_locale,
20 + unsigned char *using_locale,
21 char **locale_buf,
22 const char *category_filename,
23 int locale_buf_size_max,
24 @@ -60,20 +62,6 @@
25 struct stat st;
26 size_t namesize, bufsize;
27
28 - /* 'name' must be already checked. */
29 - if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0) {
30 - *using_locale = 0;
31 - return (_LDP_CACHE);
32 - }
33 -
34 - /*
35 - * If the locale name is the same as our cache, use the cache.
36 - */
37 - if (*locale_buf != NULL && strcmp(name, *locale_buf) == 0) {
38 - *using_locale = 1;
39 - return (_LDP_CACHE);
40 - }
41 -
42 /*
43 * Slurp the locale file into the cache.
44 */
45 @@ -164,3 +152,9 @@
46 return (i);
47 }
48
49 +__private_extern__ void
50 +__ldpart_free_extra(struct __xlocale_st_ldpart *lp)
51 +{
52 + if (lp)
53 + free(lp->_locale_buf);
54 +}