about summary refs log tree commit diff
path: root/locale/programs/localedef.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-05 23:29:24 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-05 23:29:24 +0000
commitf2b98f97ebc32b68271505131b745289f3255984 (patch)
treec0b00f281985b708c6b991648a05be6752f96868 /locale/programs/localedef.h
parent475361200b40615d2d459c8d6a7544fdf4f9533a (diff)
downloadglibc-f2b98f97ebc32b68271505131b745289f3255984.tar.gz
glibc-f2b98f97ebc32b68271505131b745289f3255984.tar.xz
glibc-f2b98f97ebc32b68271505131b745289f3255984.zip
Update.
	* inet/getnetgrent_r.c (innetgr): Add int* parameter to getfct
	definition and pass &errno in use of this variable.
	Reported by Simon Wilkinson <simon@sxw.org.uk> [PR libc/2911].

2002-02-04  Andreas Schwab  <schwab@suse.de>

	* locale/programs/localedef.h (WITH_CUR_LOCALE): Define.
	* locale/programs/charmap-dir.c: Wrap calls that output messages
	with WITH_CUR_LOCALE.  Include "localedef.h" first.
	* locale/programs/charmap.c: Likewise.
	* locale/programs/ld-address.c: Likewise.
	* locale/programs/ld-collate.c: Likewise.
	* locale/programs/ld-ctype.c: Likewise.
	* locale/programs/ld-identification.c: Likewise.
	* locale/programs/ld-measurement.c: Likewise.
	* locale/programs/ld-messages.c: Likewise.
	* locale/programs/ld-monetary.c: Likewise.
	* locale/programs/ld-name.c: Likewise.
	* locale/programs/ld-numeric.c: Likewise.
	* locale/programs/ld-paper.c: Likewise.
	* locale/programs/ld-telephone.c: Likewise.
	* locale/programs/ld-time.c: Likewise.
	* locale/programs/linereader.c: Likewise.
	* locale/programs/linereader.h: Likewise.
	* locale/programs/localedef.c: Likewise.
	* locale/programs/locfile.c: Likewise.
	* locale/programs/repertoire.c: Likewise.

2002-02-05  Ulrich Drepper  <drepper@redhat.com>
Diffstat (limited to 'locale/programs/localedef.h')
-rw-r--r--locale/programs/localedef.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/locale/programs/localedef.h b/locale/programs/localedef.h
index cdb08d8293..717962e10b 100644
--- a/locale/programs/localedef.h
+++ b/locale/programs/localedef.h
@@ -24,6 +24,7 @@
 /* Get the basic locale definitions.  */
 #include <locale.h>
 #include <stddef.h>
+#include <errno.h>
 
 #include "repertoire.h"
 
@@ -122,6 +123,19 @@ extern void *xrealloc (void *__p, size_t __n);
 extern char *xstrdup (const char *__str);
 
 
+/* Wrapper to switch LC_CTYPE back to the locale specified in the
+   environment for output.  */
+#define WITH_CUR_LOCALE(stmt)					\
+  do {								\
+      int saved_errno = errno;					\
+      const char *cur_locale_ = setlocale (LC_CTYPE, NULL);	\
+      setlocale (LC_CTYPE, "");					\
+      errno = saved_errno; 					\
+      stmt;							\
+      setlocale (LC_CTYPE, cur_locale_);			\
+  } while (0)
+
+
 /* Mark given locale as to be read.  */
 extern struct localedef_t *add_to_readlist (int locale, const char *name,
 					    const char *repertoire_name,