From 5491da0dfa50a969aca174742c64e114fe068af4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 18 Nov 1999 07:22:53 +0000 Subject: 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 . * wcsmbs/wcwidth.h (internal_wcwidth): Reject non-printable characters. --- time/strftime.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'time') 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; -- cgit v1.2.3