]>
Commit | Line | Data |
---|---|---|
dd9423a6 | 1 | /* Copyright (C) 1991, 92, 1995-2000, 2002, 2003 Free Software Foundation, Inc. |
c84142e8 | 2 | This file is part of the GNU C Library. |
28f540f4 | 3 | |
c84142e8 | 4 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
28f540f4 | 8 | |
c84142e8 UD |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 AJ |
14 | You should have received a copy of the GNU Lesser General Public |
15 | License along with the GNU C Library; if not, write to the Free | |
16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | 02111-1307 USA. */ | |
28f540f4 | 18 | |
7a12c6bb RM |
19 | #include <alloca.h> |
20 | #include <argz.h> | |
28f540f4 | 21 | #include <errno.h> |
5107cf1d | 22 | #include <bits/libc-lock.h> |
933e73fa | 23 | #include <locale.h> |
7a12c6bb RM |
24 | #include <stdlib.h> |
25 | #include <string.h> | |
26 | #include <unistd.h> | |
27 | ||
933e73fa RM |
28 | #include "localeinfo.h" |
29 | ||
1a0d874e RM |
30 | #ifdef NL_CURRENT_INDIRECT |
31 | ||
32 | /* For each category declare a special external symbol | |
33 | _nl_current_CATEGORY_used with a weak reference. | |
34 | This symbol will is defined in lc-CATEGORY.c and will be linked in | |
35 | if anything uses _nl_current_CATEGORY (also defined in that module). | |
36 | Also use a weak reference for the _nl_current_CATEGORY thread variable. */ | |
37 | ||
38 | # define DEFINE_CATEGORY(category, category_name, items, a) \ | |
39 | extern char _nl_current_##category##_used; \ | |
40 | weak_extern (_nl_current_##category##_used) \ | |
41 | weak_extern (_nl_current_##category) | |
42 | # include "categories.def" | |
43 | # undef DEFINE_CATEGORY | |
44 | ||
45 | /* Now define a table of flags based on those special weak symbols' values. | |
46 | _nl_current_used[CATEGORY] will be zero if _nl_current_CATEGORY is not | |
47 | linked in. */ | |
48 | static char *const _nl_current_used[] = | |
036cc82f | 49 | { |
1a0d874e RM |
50 | # define DEFINE_CATEGORY(category, category_name, items, a) \ |
51 | [category] = &_nl_current_##category##_used, | |
52 | # include "categories.def" | |
53 | # undef DEFINE_CATEGORY | |
036cc82f | 54 | }; |
933e73fa | 55 | |
1a0d874e | 56 | # define CATEGORY_USED(category) (_nl_current_used[category] != 0) |
30c14c31 RM |
57 | |
58 | #else | |
59 | ||
60 | /* The shared library always loads all the categories, | |
61 | and the current global settings are kept in _nl_global_locale. */ | |
62 | ||
30c14c31 RM |
63 | # define CATEGORY_USED(category) (1) |
64 | ||
65 | #endif | |
66 | ||
933e73fa RM |
67 | |
68 | /* Define an array of category names (also the environment variable names), | |
4b10dd6c UD |
69 | indexed by integral category. */ |
70 | const char *const _nl_category_names[] = | |
933e73fa | 71 | { |
4b10dd6c | 72 | #define DEFINE_CATEGORY(category, category_name, items, a) \ |
933e73fa RM |
73 | [category] = category_name, |
74 | #include "categories.def" | |
75 | #undef DEFINE_CATEGORY | |
7a12c6bb | 76 | [LC_ALL] = "LC_ALL" |
933e73fa RM |
77 | }; |
78 | /* An array of their lengths, for convenience. */ | |
79 | const size_t _nl_category_name_sizes[] = | |
80 | { | |
4b10dd6c | 81 | #define DEFINE_CATEGORY(category, category_name, items, a) \ |
933e73fa RM |
82 | [category] = sizeof (category_name) - 1, |
83 | #include "categories.def" | |
84 | #undef DEFINE_CATEGORY | |
7a12c6bb | 85 | [LC_ALL] = sizeof ("LC_ALL") - 1 |
933e73fa | 86 | }; |
28f540f4 RM |
87 | |
88 | ||
0ba454fc RM |
89 | #ifdef NL_CURRENT_INDIRECT |
90 | # define WEAK_POSTLOAD(postload) weak_extern (postload) | |
91 | #else | |
92 | # define WEAK_POSTLOAD(postload) /* Need strong refs in static linking. */ | |
93 | #endif | |
94 | ||
933e73fa RM |
95 | /* Declare the postload functions used below. */ |
96 | #undef NO_POSTLOAD | |
97 | #define NO_POSTLOAD _nl_postload_ctype /* Harmless thing known to exist. */ | |
4b10dd6c | 98 | #define DEFINE_CATEGORY(category, category_name, items, postload) \ |
0ba454fc | 99 | extern void postload (void); WEAK_POSTLOAD (postload) |
933e73fa RM |
100 | #include "categories.def" |
101 | #undef DEFINE_CATEGORY | |
102 | #undef NO_POSTLOAD | |
103 | ||
104 | /* Define an array indexed by category of postload functions to call after | |
105 | loading and installing that category's data. */ | |
a5113b14 | 106 | static void (*const _nl_category_postload[]) (void) = |
933e73fa | 107 | { |
4b10dd6c | 108 | #define DEFINE_CATEGORY(category, category_name, items, postload) \ |
933e73fa RM |
109 | [category] = postload, |
110 | #include "categories.def" | |
111 | #undef DEFINE_CATEGORY | |
112 | }; | |
113 | ||
114 | ||
a5113b14 | 115 | /* Lock for protecting global data. */ |
ab26a24a | 116 | __libc_lock_define_initialized (, __libc_setlocale_lock attribute_hidden) |
a5113b14 | 117 | |
111bb972 UD |
118 | /* Defined in loadmsgcat.c. */ |
119 | extern int _nl_msg_cat_cntr; | |
120 | ||
933e73fa | 121 | |
7a12c6bb RM |
122 | /* Use this when we come along an error. */ |
123 | #define ERROR_RETURN \ | |
124 | do { \ | |
c4029823 | 125 | __set_errno (EINVAL); \ |
7a12c6bb RM |
126 | return NULL; \ |
127 | } while (0) | |
933e73fa | 128 | |
7a12c6bb | 129 | |
7a12c6bb | 130 | /* Construct a new composite name. */ |
dd9423a6 | 131 | static char * |
4b10dd6c | 132 | new_composite_name (int category, const char *newnames[__LC_LAST]) |
7a12c6bb | 133 | { |
e918a7fe | 134 | size_t last_len = 0; |
7a12c6bb RM |
135 | size_t cumlen = 0; |
136 | int i; | |
137 | char *new, *p; | |
138 | int same = 1; | |
139 | ||
4b10dd6c UD |
140 | for (i = 0; i < __LC_LAST; ++i) |
141 | if (i != LC_ALL) | |
142 | { | |
143 | const char *name = (category == LC_ALL ? newnames[i] : | |
144 | category == i ? newnames[0] : | |
1ce8aaae | 145 | _nl_global_locale.__names[i]); |
4b10dd6c UD |
146 | last_len = strlen (name); |
147 | cumlen += _nl_category_name_sizes[i] + 1 + last_len + 1; | |
148 | if (i > 0 && same && strcmp (name, newnames[0]) != 0) | |
149 | same = 0; | |
150 | } | |
7a12c6bb RM |
151 | |
152 | if (same) | |
933e73fa | 153 | { |
7a12c6bb | 154 | /* All the categories use the same name. */ |
72c74375 UD |
155 | if (strcmp (newnames[0], _nl_C_name) == 0 |
156 | || strcmp (newnames[0], _nl_POSIX_name) == 0) | |
7a12c6bb RM |
157 | return (char *) _nl_C_name; |
158 | ||
159 | new = malloc (last_len + 1); | |
7a12c6bb | 160 | |
036cc82f | 161 | return new == NULL ? NULL : memcpy (new, newnames[0], last_len + 1); |
933e73fa | 162 | } |
7a12c6bb RM |
163 | |
164 | new = malloc (cumlen); | |
165 | if (new == NULL) | |
166 | return NULL; | |
167 | p = new; | |
4b10dd6c UD |
168 | for (i = 0; i < __LC_LAST; ++i) |
169 | if (i != LC_ALL) | |
170 | { | |
171 | /* Add "CATEGORY=NAME;" to the string. */ | |
172 | const char *name = (category == LC_ALL ? newnames[i] : | |
173 | category == i ? newnames[0] : | |
1ce8aaae | 174 | _nl_global_locale.__names[i]); |
4b10dd6c UD |
175 | p = __stpcpy (p, _nl_category_names[i]); |
176 | *p++ = '='; | |
177 | p = __stpcpy (p, name); | |
178 | *p++ = ';'; | |
179 | } | |
7a12c6bb RM |
180 | p[-1] = '\0'; /* Clobber the last ';'. */ |
181 | return new; | |
182 | } | |
933e73fa | 183 | |
933e73fa | 184 | |
1ce8aaae | 185 | /* Put NAME in _nl_global_locale.__names. */ |
7a12c6bb RM |
186 | static inline void |
187 | setname (int category, const char *name) | |
188 | { | |
1ce8aaae | 189 | if (_nl_global_locale.__names[category] == name) |
762a2918 UD |
190 | return; |
191 | ||
1ce8aaae RM |
192 | if (_nl_global_locale.__names[category] != _nl_C_name) |
193 | free ((char *) _nl_global_locale.__names[category]); | |
7a12c6bb | 194 | |
1ce8aaae | 195 | _nl_global_locale.__names[category] = name; |
7a12c6bb RM |
196 | } |
197 | ||
7a12c6bb RM |
198 | /* Put DATA in *_nl_current[CATEGORY]. */ |
199 | static inline void | |
c84142e8 | 200 | setdata (int category, struct locale_data *data) |
7a12c6bb | 201 | { |
30c14c31 | 202 | if (CATEGORY_USED (category)) |
933e73fa | 203 | { |
30c14c31 | 204 | _nl_global_locale.__locales[category] = data; |
7a12c6bb RM |
205 | if (_nl_category_postload[category]) |
206 | (*_nl_category_postload[category]) (); | |
933e73fa | 207 | } |
7a12c6bb | 208 | } |
933e73fa | 209 | |
7a12c6bb RM |
210 | char * |
211 | setlocale (int category, const char *locale) | |
212 | { | |
7a12c6bb RM |
213 | char *locale_path; |
214 | size_t locale_path_len; | |
d68171ed | 215 | const char *locpath_var; |
7a12c6bb | 216 | char *composite; |
933e73fa | 217 | |
7a12c6bb | 218 | /* Sanity check for CATEGORY argument. */ |
323fb88d UD |
219 | if (__builtin_expect (category, 0) < 0 |
220 | || __builtin_expect (category, 0) >= __LC_LAST) | |
7a12c6bb RM |
221 | ERROR_RETURN; |
222 | ||
223 | /* Does user want name of current locale? */ | |
224 | if (locale == NULL) | |
1ce8aaae | 225 | return (char *) _nl_global_locale.__names[category]; |
7a12c6bb | 226 | |
1ce8aaae | 227 | if (strcmp (locale, _nl_global_locale.__names[category]) == 0) |
933e73fa | 228 | /* Changing to the same thing. */ |
1ce8aaae | 229 | return (char *) _nl_global_locale.__names[category]; |
7a12c6bb RM |
230 | |
231 | /* We perhaps really have to load some data. So we determine the | |
a5113b14 UD |
232 | path in which to look for the data now. The environment variable |
233 | `LOCPATH' must only be used when the binary has no SUID or SGID | |
cb09a2cd RM |
234 | bit set. If using the default path, we tell _nl_find_locale |
235 | by passing null and it can check the canonical locale archive. */ | |
7a12c6bb RM |
236 | locale_path = NULL; |
237 | locale_path_len = 0; | |
238 | ||
74955460 | 239 | locpath_var = getenv ("LOCPATH"); |
d68171ed | 240 | if (locpath_var != NULL && locpath_var[0] != '\0') |
cb09a2cd RM |
241 | { |
242 | if (__argz_create_sep (locpath_var, ':', | |
243 | &locale_path, &locale_path_len) != 0) | |
244 | return NULL; | |
933e73fa | 245 | |
cb09a2cd RM |
246 | if (__argz_add_sep (&locale_path, &locale_path_len, |
247 | _nl_default_locale_path, ':') != 0) | |
248 | return NULL; | |
249 | } | |
db2286f6 | 250 | |
933e73fa RM |
251 | if (category == LC_ALL) |
252 | { | |
7a12c6bb RM |
253 | /* The user wants to set all categories. The desired locales |
254 | for the individual categories can be selected by using a | |
255 | composite locale name. This is a semi-colon separated list | |
256 | of entries of the form `CATEGORY=VALUE'. */ | |
4b10dd6c UD |
257 | const char *newnames[__LC_LAST]; |
258 | struct locale_data *newdata[__LC_LAST]; | |
933e73fa RM |
259 | |
260 | /* Set all name pointers to the argument name. */ | |
4b10dd6c UD |
261 | for (category = 0; category < __LC_LAST; ++category) |
262 | if (category != LC_ALL) | |
263 | newnames[category] = (char *) locale; | |
db2286f6 | 264 | |
323fb88d | 265 | if (__builtin_expect (strchr (locale, ';') != NULL, 0)) |
933e73fa | 266 | { |
7a12c6bb RM |
267 | /* This is a composite name. Make a copy and split it up. */ |
268 | char *np = strdupa (locale); | |
269 | char *cp; | |
270 | int cnt; | |
933e73fa | 271 | |
7a12c6bb | 272 | while ((cp = strchr (np, '=')) != NULL) |
933e73fa | 273 | { |
4b10dd6c UD |
274 | for (cnt = 0; cnt < __LC_LAST; ++cnt) |
275 | if (cnt != LC_ALL | |
276 | && (size_t) (cp - np) == _nl_category_name_sizes[cnt] | |
7a12c6bb | 277 | && memcmp (np, _nl_category_names[cnt], cp - np) == 0) |
933e73fa | 278 | break; |
7a12c6bb | 279 | |
4b10dd6c | 280 | if (cnt == __LC_LAST) |
7a12c6bb RM |
281 | /* Bogus category name. */ |
282 | ERROR_RETURN; | |
283 | ||
284 | /* Found the category this clause sets. */ | |
285 | newnames[cnt] = ++cp; | |
286 | cp = strchr (cp, ';'); | |
287 | if (cp != NULL) | |
933e73fa | 288 | { |
7a12c6bb RM |
289 | /* Examine the next clause. */ |
290 | *cp = '\0'; | |
291 | np = cp + 1; | |
933e73fa | 292 | } |
7a12c6bb RM |
293 | else |
294 | /* This was the last clause. We are done. */ | |
295 | break; | |
933e73fa RM |
296 | } |
297 | ||
4b10dd6c UD |
298 | for (cnt = 0; cnt < __LC_LAST; ++cnt) |
299 | if (cnt != LC_ALL && newnames[cnt] == locale) | |
933e73fa | 300 | /* The composite name did not specify all categories. */ |
7a12c6bb | 301 | ERROR_RETURN; |
933e73fa | 302 | } |
19bc17a9 | 303 | |
a5113b14 | 304 | /* Protect global data. */ |
c4029823 | 305 | __libc_lock_lock (__libc_setlocale_lock); |
a5113b14 | 306 | |
933e73fa RM |
307 | /* Load the new data for each category. */ |
308 | while (category-- > 0) | |
ef5d6645 UD |
309 | if (category != LC_ALL) |
310 | { | |
ef5d6645 UD |
311 | newdata[category] = _nl_find_locale (locale_path, locale_path_len, |
312 | category, | |
313 | &newnames[category]); | |
1fb05e3d | 314 | |
ef5d6645 | 315 | if (newdata[category] == NULL) |
9a411bf5 RM |
316 | { |
317 | #ifdef NL_CURRENT_INDIRECT | |
318 | if (newnames[category] == _nl_C_name) | |
319 | /* Null because it's the weak value of _nl_C_LC_FOO. */ | |
320 | continue; | |
321 | #endif | |
322 | break; | |
323 | } | |
1fb05e3d | 324 | |
a31f867a UD |
325 | /* We must not simply free a global locale since we have |
326 | no control over the usage. So we mark it as | |
327 | un-deletable. And yes, the 'if' is needed, the data | |
328 | might be in read-only memory. */ | |
ef5d6645 UD |
329 | if (newdata[category]->usage_count != UNDELETABLE) |
330 | newdata[category]->usage_count = UNDELETABLE; | |
411adb10 UD |
331 | |
332 | /* Make a copy of locale name. */ | |
333 | if (newnames[category] != _nl_C_name) | |
334 | { | |
a31f867a UD |
335 | if (strcmp (newnames[category], |
336 | _nl_global_locale.__names[category]) == 0) | |
337 | newnames[category] = _nl_global_locale.__names[category]; | |
338 | else | |
339 | { | |
340 | newnames[category] = __strdup (newnames[category]); | |
341 | if (newnames[category] == NULL) | |
342 | break; | |
343 | } | |
411adb10 | 344 | } |
ef5d6645 | 345 | } |
933e73fa | 346 | |
7a12c6bb | 347 | /* Create new composite name. */ |
d4c5cf80 UD |
348 | composite = (category >= 0 |
349 | ? NULL : new_composite_name (LC_ALL, newnames)); | |
350 | if (composite != NULL) | |
933e73fa | 351 | { |
a5113b14 | 352 | /* Now we have loaded all the new data. Put it in place. */ |
4b10dd6c UD |
353 | for (category = 0; category < __LC_LAST; ++category) |
354 | if (category != LC_ALL) | |
355 | { | |
356 | setdata (category, newdata[category]); | |
357 | setname (category, newnames[category]); | |
358 | } | |
a5113b14 | 359 | setname (LC_ALL, composite); |
111bb972 UD |
360 | |
361 | /* We successfully loaded a new locale. Let the message catalog | |
362 | functions know about this. */ | |
363 | ++_nl_msg_cat_cntr; | |
933e73fa | 364 | } |
411adb10 UD |
365 | else |
366 | for (++category; category < __LC_LAST; ++category) | |
a31f867a UD |
367 | if (category != LC_ALL && newnames[category] != _nl_C_name |
368 | && newnames[category] != _nl_global_locale.__names[category]) | |
411adb10 | 369 | free ((char *) newnames[category]); |
a5113b14 UD |
370 | |
371 | /* Critical section left. */ | |
c4029823 | 372 | __libc_lock_unlock (__libc_setlocale_lock); |
933e73fa | 373 | |
714a562f UD |
374 | /* Free the resources (the locale path variable. */ |
375 | free (locale_path); | |
376 | ||
933e73fa RM |
377 | return composite; |
378 | } | |
379 | else | |
380 | { | |
c84142e8 | 381 | struct locale_data *newdata = NULL; |
650425ce | 382 | const char *newname[1] = { locale }; |
7a12c6bb | 383 | |
a5113b14 | 384 | /* Protect global data. */ |
c4029823 | 385 | __libc_lock_lock (__libc_setlocale_lock); |
a5113b14 | 386 | |
30c14c31 | 387 | if (CATEGORY_USED (category)) |
933e73fa | 388 | { |
7a12c6bb | 389 | /* Only actually load the data if anything will use it. */ |
7a12c6bb | 390 | newdata = _nl_find_locale (locale_path, locale_path_len, category, |
650425ce | 391 | &newname[0]); |
7a12c6bb | 392 | if (newdata == NULL) |
a5113b14 | 393 | goto abort_single; |
c84142e8 UD |
394 | |
395 | /* We must not simply free a global locale since we have no | |
a2b08ee5 UD |
396 | control over the usage. So we mark it as un-deletable. |
397 | ||
3081378b | 398 | Note: do not remove the `if', it's necessary to copy with |
a2b08ee5 | 399 | the builtin locale data. */ |
9756dfe1 UD |
400 | if (newdata->usage_count != UNDELETABLE) |
401 | newdata->usage_count = UNDELETABLE; | |
933e73fa RM |
402 | } |
403 | ||
411adb10 UD |
404 | /* Make a copy of locale name. */ |
405 | if (newname[0] != _nl_C_name) | |
406 | { | |
1ce8aaae | 407 | newname[0] = __strdup (newname[0]); |
411adb10 UD |
408 | if (newname[0] == NULL) |
409 | goto abort_single; | |
410 | } | |
411 | ||
7a12c6bb | 412 | /* Create new composite name. */ |
650425ce | 413 | composite = new_composite_name (category, newname); |
7a12c6bb | 414 | if (composite == NULL) |
933e73fa | 415 | { |
411adb10 UD |
416 | if (newname[0] != _nl_C_name) |
417 | free ((char *) newname[0]); | |
418 | ||
845dcb57 | 419 | /* Say that we don't have any data loaded. */ |
a5113b14 | 420 | abort_single: |
650425ce | 421 | newname[0] = NULL; |
933e73fa | 422 | } |
a5113b14 UD |
423 | else |
424 | { | |
30c14c31 | 425 | if (CATEGORY_USED (category)) |
a5113b14 | 426 | setdata (category, newdata); |
28f540f4 | 427 | |
650425ce | 428 | setname (category, newname[0]); |
a5113b14 | 429 | setname (LC_ALL, composite); |
111bb972 UD |
430 | |
431 | /* We successfully loaded a new locale. Let the message catalog | |
432 | functions know about this. */ | |
433 | ++_nl_msg_cat_cntr; | |
a5113b14 | 434 | } |
28f540f4 | 435 | |
a5113b14 | 436 | /* Critical section left. */ |
c4029823 | 437 | __libc_lock_unlock (__libc_setlocale_lock); |
28f540f4 | 438 | |
714a562f UD |
439 | /* Free the resources (the locale path variable. */ |
440 | free (locale_path); | |
441 | ||
650425ce | 442 | return (char *) newname[0]; |
933e73fa | 443 | } |
28f540f4 | 444 | } |
30c14c31 | 445 | libc_hidden_def (setlocale) |
f84ad0b1 | 446 | |
1a0d874e RM |
447 | static void |
448 | free_category (int category, | |
449 | struct locale_data *here, struct locale_data *c_data) | |
450 | { | |
451 | struct loaded_l10nfile *runp = _nl_locale_file_list[category]; | |
452 | ||
453 | /* If this category is already "C" don't do anything. */ | |
454 | if (here != c_data) | |
455 | { | |
456 | /* We have to be prepared that sometime later we still | |
457 | might need the locale information. */ | |
458 | setdata (category, c_data); | |
459 | setname (category, _nl_C_name); | |
460 | } | |
461 | ||
462 | while (runp != NULL) | |
463 | { | |
464 | struct loaded_l10nfile *curr = runp; | |
465 | struct locale_data *data = (struct locale_data *) runp->data; | |
466 | ||
467 | if (data != NULL && data != c_data) | |
468 | _nl_unload_locale (data); | |
469 | runp = runp->next; | |
470 | free ((char *) curr->filename); | |
471 | free (curr); | |
472 | } | |
473 | } | |
474 | ||
c877418f | 475 | libc_freeres_fn (free_mem) |
f84ad0b1 | 476 | { |
1a0d874e RM |
477 | #ifdef NL_CURRENT_INDIRECT |
478 | /* We don't use the loop because we want to have individual weak | |
479 | symbol references here. */ | |
480 | # define DEFINE_CATEGORY(category, category_name, items, a) \ | |
481 | if (CATEGORY_USED (category)) \ | |
482 | { \ | |
483 | extern struct locale_data _nl_C_##category; \ | |
484 | weak_extern (_nl_C_##category) \ | |
485 | free_category (category, *_nl_current_##category, &_nl_C_##category); \ | |
486 | } | |
487 | # include "categories.def" | |
488 | # undef DEFINE_CATEGORY | |
489 | #else | |
f84ad0b1 UD |
490 | int category; |
491 | ||
4b10dd6c UD |
492 | for (category = 0; category < __LC_LAST; ++category) |
493 | if (category != LC_ALL) | |
1a0d874e RM |
494 | free_category (category, _NL_CURRENT_DATA (category), |
495 | _nl_C_locobj.__locales[category]); | |
496 | #endif | |
f84ad0b1 UD |
497 | |
498 | setname (LC_ALL, _nl_C_name); | |
a89a3dab RM |
499 | |
500 | /* This frees the data structures associated with the locale archive. | |
501 | The locales from the archive are not in the file list, so we have | |
502 | not called _nl_unload_locale on them above. */ | |
503 | _nl_archive_subfreeres (); | |
f84ad0b1 | 504 | } |