about summary refs log tree commit diff
path: root/locale/setlocale.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-30 10:36:44 +0000
committerRoland McGrath <roland@gnu.org>2002-08-30 10:36:44 +0000
commit1ce8aaaedbf549702c607e8a944bcb06b2c37544 (patch)
tree76190020f59b42303fd7586536c5257634f6623c /locale/setlocale.c
parentccaf7306707314c44a8f636cc198a80fa7db12b1 (diff)
downloadglibc-1ce8aaaedbf549702c607e8a944bcb06b2c37544.tar.gz
glibc-1ce8aaaedbf549702c607e8a944bcb06b2c37544.tar.xz
glibc-1ce8aaaedbf549702c607e8a944bcb06b2c37544.zip
* locale/xlocale.h (struct __locale_struct): New member `__names'.
	* locale/xlocale.c (_nl_C_locobj): Update initializer.
	* locale/global-locale.c (_nl_global_locale): Likewise.
	* locale/duplocale.c (__duplocale): strdup __names elements.
	* locale/freelocale.c (__freelocale): Free __names elements.
	* locale/localename.c (_nl_current_names): Variable removed.
	(__current_locale_name): Use _NL_CURRENT_LOCALE->__names instead.
	* locale/localeinfo.h (_nl_current_names): Removed decl.
	* locale/setlocale.c: Use _nl_global_locale->__names in place of
	_nl_current_names throughout.

	* locale/setlocale.c (setlocale): strdup -> __strdup (not ISO C).

	* sysdeps/gnu/errlist-compat.awk: Emit link_warnings for sys_errlist
	and sys_nerr in the output file.

	* sunrpc/Makefile (rpcgen-cmd): Pass CPP in rpcgen's environment.
	* scripts/cpp: Just use the environment variable.

	* libio/tst-mmap-setvbuf.c (main): Use 'm' fopen flag.
	* libio/tst-mmap-offend.c (do_test): Likewise.
	* libio/tst-mmap-fflushsync.c (do_test): Likewise.
	* libio/tst-mmap-eofsync.c (do_test): Likewise.
	* libio/tst-mmap2-eofsync.c (do_test): Likewise.
Diffstat (limited to 'locale/setlocale.c')
-rw-r--r--locale/setlocale.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/locale/setlocale.c b/locale/setlocale.c
index c64db08f05..a48f171c92 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -136,7 +136,7 @@ new_composite_name (int category, const char *newnames[__LC_LAST])
       {
 	const char *name = (category == LC_ALL ? newnames[i] :
 			    category == i ? newnames[0] :
-			    _nl_current_names[i]);
+			    _nl_global_locale.__names[i]);
 	last_len = strlen (name);
 	cumlen += _nl_category_name_sizes[i] + 1 + last_len + 1;
 	if (i > 0 && same && strcmp (name, newnames[0]) != 0)
@@ -165,7 +165,7 @@ new_composite_name (int category, const char *newnames[__LC_LAST])
 	/* Add "CATEGORY=NAME;" to the string.  */
 	const char *name = (category == LC_ALL ? newnames[i] :
 			    category == i ? newnames[0] :
-			    _nl_current_names[i]);
+			    _nl_global_locale.__names[i]);
 	p = __stpcpy (p, _nl_category_names[i]);
 	*p++ = '=';
 	p = __stpcpy (p, name);
@@ -176,17 +176,17 @@ new_composite_name (int category, const char *newnames[__LC_LAST])
 }
 
 
-/* Put NAME in _nl_current_names.  */
+/* Put NAME in _nl_global_locale.__names.  */
 static inline void
 setname (int category, const char *name)
 {
-  if (_nl_current_names[category] == name)
+  if (_nl_global_locale.__names[category] == name)
     return;
 
-  if (_nl_current_names[category] != _nl_C_name)
-    free ((char *) _nl_current_names[category]);
+  if (_nl_global_locale.__names[category] != _nl_C_name)
+    free ((char *) _nl_global_locale.__names[category]);
 
-  _nl_current_names[category] = name;
+  _nl_global_locale.__names[category] = name;
 }
 
 /* Put DATA in *_nl_current[CATEGORY].  */
@@ -216,11 +216,11 @@ setlocale (int category, const char *locale)
 
   /* Does user want name of current locale?  */
   if (locale == NULL)
-    return (char *) _nl_current_names[category];
+    return (char *) _nl_global_locale.__names[category];
 
-  if (strcmp (locale, _nl_current_names[category]) == 0)
+  if (strcmp (locale, _nl_global_locale.__names[category]) == 0)
     /* Changing to the same thing.  */
-    return (char *) _nl_current_names[category];
+    return (char *) _nl_global_locale.__names[category];
 
   /* We perhaps really have to load some data.  So we determine the
      path in which to look for the data now.  The environment variable
@@ -324,7 +324,7 @@ setlocale (int category, const char *locale)
 	    /* Make a copy of locale name.  */
 	    if (newnames[category] != _nl_C_name)
 	      {
-		newnames[category] = strdup (newnames[category]);
+		newnames[category] = __strdup (newnames[category]);
 		if (newnames[category] == NULL)
 		  break;
 	      }
@@ -389,7 +389,7 @@ setlocale (int category, const char *locale)
       /* Make a copy of locale name.  */
       if (newname[0] != _nl_C_name)
 	{
-	  newname[0] = strdup (newname[0]);
+	  newname[0] = __strdup (newname[0]);
 	  if (newname[0] == NULL)
 	    goto abort_single;
 	}