summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-06-29 00:17:44 +0000
committerUlrich Drepper <drepper@redhat.com>2001-06-29 00:17:44 +0000
commit90e5b29e1470b218fe4288df7c58593e2f8fd753 (patch)
treef7e4469da4867fa59b5a3ec3732e872891e9f391 /locale
parent5746ef6f2a918bcd476d4e33017edcec22684928 (diff)
downloadglibc-90e5b29e1470b218fe4288df7c58593e2f8fd753.tar.gz
glibc-90e5b29e1470b218fe4288df7c58593e2f8fd753.tar.xz
glibc-90e5b29e1470b218fe4288df7c58593e2f8fd753.zip
Update.
	* manual/users.texi (Setting Groups): Correct initgroups
	documentation.  Add documentation for getgrouplist.

2001-06-28  H.J. Lu  <hjl@gnu.org>

	* 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  <kettenis@gnu.org>

2001-06-20  Isamu Hasegawa  <isamu@yamato.ibm.com>
2001-06-26  Isamu Hasegawa  <isamu@yamato.ibm.com>
	* posix/regex.c (count_mbs_length): Use binary search for optimization.
Diffstat (limited to 'locale')
-rw-r--r--locale/setlocale.c28
1 files changed, 21 insertions, 7 deletions
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);