]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/ldpart.c.patch
19e299cff2ccef46e7ceea503c6617bd88652f56
[apple/libc.git] / locale / FreeBSD / ldpart.c.patch
1 --- ldpart.c.orig Tue May 20 15:21:44 2003
2 +++ ldpart.c Wed Jun 11 13:11:52 2003
3 @@ -47,7 +47,7 @@
4 int
5 __part_load_locale(const char *name,
6 int *using_locale,
7 - char *locale_buf,
8 + char **locale_buf,
9 const char *category_filename,
10 int locale_buf_size_max,
11 int locale_buf_size_min,
12 @@ -69,7 +69,7 @@
13 /*
14 * If the locale name is the same as our cache, use the cache.
15 */
16 - if (locale_buf != NULL && strcmp(name, locale_buf) == 0) {
17 + if (*locale_buf != NULL && strcmp(name, *locale_buf) == 0) {
18 *using_locale = 1;
19 return (_LDP_CACHE);
20 }
21 @@ -124,10 +124,10 @@
22 /*
23 * Record the successful parse in the cache.
24 */
25 - if (locale_buf != NULL)
26 - free(locale_buf);
27 - locale_buf = lbuf;
28 - for (p = locale_buf, i = 0; i < num_lines; i++)
29 + if (*locale_buf != NULL)
30 + free(*locale_buf);
31 + *locale_buf = lbuf;
32 + for (p = *locale_buf, i = 0; i < num_lines; i++)
33 dst_localebuf[i] = (p += strlen(p) + 1);
34 for (i = num_lines; i < locale_buf_size_max; i++)
35 dst_localebuf[i] = NULL;