From 90e5b29e1470b218fe4288df7c58593e2f8fd753 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 29 Jun 2001 00:17:44 +0000 Subject: Update. * manual/users.texi (Setting Groups): Correct initgroups documentation. Add documentation for getgrouplist. 2001-06-28 H.J. Lu * locale/findlocale.c (locale_file_list): Renamed to ... (_nl_locale_file_list): This. Make it extern. (free_mem): Move to ... * locale/setlocale.c (free_mem): Here. 2001-06-28 Mark Kettenis 2001-06-20 Isamu Hasegawa 2001-06-26 Isamu Hasegawa * posix/regex.c (count_mbs_length): Use binary search for optimization. --- locale/setlocale.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'locale/setlocale.c') diff --git a/locale/setlocale.c b/locale/setlocale.c index c7848b9a5c..c5a8d49069 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -430,6 +430,7 @@ setlocale (int category, const char *locale) } } +extern struct loaded_l10nfile *_nl_locale_file_list[]; static void __attribute__ ((unused)) free_mem (void) @@ -440,17 +441,30 @@ free_mem (void) if (category != LC_ALL) { struct locale_data *here = *_nl_current[category]; + struct loaded_l10nfile *runp = _nl_locale_file_list[category]; /* If this category is already "C" don't do anything. */ - if (here == _nl_C[category]) - continue; + if (here != _nl_C[category]) + { + /* We have to be prepared that sometime later me still + might need the locale information. */ + setdata (category, _nl_C[category]); + setname (category, _nl_C_name); - /* We have to be prepared that sometime later me still might - need the locale information. */ - setdata (category, _nl_C[category]); - setname (category, _nl_C_name); + _nl_unload_locale (here); + } - _nl_unload_locale (here); + while (runp != NULL) + { + struct loaded_l10nfile *curr = runp; + struct locale_data *data = (struct locale_data *) runp->data; + + if (data != NULL && data != here && data != _nl_C[category]) + _nl_unload_locale (data); + runp = runp->next; + free ((char *) curr->filename); + free (curr); + } } setname (LC_ALL, _nl_C_name); -- cgit 1.4.1