about summary refs log tree commit diff
path: root/time
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 /time
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 'time')
-rw-r--r--time/strftime.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/time/strftime.c b/time/strftime.c
index bcd7ff1e16..3c8cfeed17 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -834,11 +834,15 @@ my_strftime (s, maxsize, format, tp ut_argument)
 	      if (era)
 		{
 # ifdef COMPILE_WIDE
-		  /* The wide name is after the single byte name and
+		  /* The wide name is after the multi byte name and
                      format.  */
+		  wchar_t *ws;
+		  size_t len;
 		  char *tcp = strchr (era->name_fmt, '\0') + 1;
-		  wchar_t *ws = (wchar_t *) (strchr (tcp, '\0') + 1);
-		  size_t len = wcslen (ws);
+		  tcp = strchr (tcp, '\0') + 1;
+		  tcp += 3 - (((tcp - era->name_fmt) + 3) & 3);
+		  ws = (wchar_t *) tcp;
+		  len = wcslen (ws);
 		  cpy (len, ws);
 # else
 		  size_t len = strlen (era->name_fmt);
@@ -1195,10 +1199,12 @@ my_strftime (s, maxsize, format, tp ut_argument)
 	      if (era)
 		{
 # ifdef COMPILE_WIDE
-		  /* The wide name is after the single byte name and
+		  /* The wide name is after the multi byte name and
                      format.  */
 		  char *tcp = strchr (era->name_fmt, '\0') + 1;
-		  subfmt = (wchar_t *) (strchr (tcp, '\0') + 1);
+		  tcp = strchr (tcp, '\0') + 1;
+		  tcp += 3 - (((tcp - era->name_fmt) + 3) & 3);
+		  subfmt = (wchar_t *) tcp;
 		  subfmt = wcschr (subfmt, L'\0') + 1;
 # else
 		  subfmt = strchr (era->name_fmt, '\0') + 1;