about summary refs log tree commit diff
path: root/wctype/wctrans.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-11-18 07:22:53 +0000
committerUlrich Drepper <drepper@redhat.com>1999-11-18 07:22:53 +0000
commit5491da0dfa50a969aca174742c64e114fe068af4 (patch)
tree06cf1a3e5b8b58cfbd76f575e6a2e0363c0ab61e /wctype/wctrans.c
parent35946fb706d6333c5c11663fd0b46c1e9116ae0f (diff)
downloadglibc-5491da0dfa50a969aca174742c64e114fe068af4.tar.gz
glibc-5491da0dfa50a969aca174742c64e114fe068af4.tar.xz
glibc-5491da0dfa50a969aca174742c64e114fe068af4.zip
Update.
	* locale/programs/ld-ctype.c (ctype_output): Correct computation of
	nelems.  Correctly compute index for additional character classes.
	(ctype_read): Handle charclass and charconv definitions.  Also
	recognize arbitrary strings as mapping names.
	* locale/programs/ld-time.c (time_finish): Correctly skip over wide
	character era strings.
	* locale/lc-time.c (_nl_get_era_entry): Correctly skip era name
	and format for wide characters.
	* time/strftime.c: Correctly determine era information for wide
	wcsftime.
	* wctrans.c: Fix after removal of second endianess table.
	* wctype/wctype.h (_ISwbit): Correctly handle bits > 16.
	Patches by Shinya Hanataka <hanataka@abyss.rim.or.jp>.

	* wcsmbs/wcwidth.h (internal_wcwidth): Reject non-printable characters.
Diffstat (limited to 'wctype/wctrans.c')
-rw-r--r--wctype/wctrans.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/wctype/wctrans.c b/wctype/wctrans.c
index 3f823e56a8..3c46131f24 100644
--- a/wctype/wctrans.c
+++ b/wctype/wctrans.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <ctype.h>
+#include <inttypes.h>
 #include <string.h>
 #include <wctype.h>
 #include "../locale/localeinfo.h"
@@ -27,7 +28,7 @@ wctrans (const char *property)
 {
   const char *names;
   size_t cnt;
-  unsigned int **result;
+  int32_t *result;
 
   names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_MAP_NAMES);
   cnt = 0;
@@ -49,11 +50,7 @@ wctrans (const char *property)
     return (wctrans_t) __ctype_tolower;
 
   /* We have to search the table.  */
-  result = (unsigned int **) &_NL_CURRENT (LC_CTYPE, _NL_CTYPE_WIDTH);
+  result = (int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_WIDTH + cnt - 2);
 
-#if __BYTE_ORDER == _BIG_ENDIAN
-  return (wctrans_t) result[1 + 2 * cnt];
-#else
-  return (wctrans_t) result[1 + 2 * cnt + 1];
-#endif
+  return (wctrans_t) (result + 128);
 }