aboutsummaryrefslogtreecommitdiff
path: root/time/strftime.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-21 17:50:57 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-21 17:50:57 +0000
commit958d68077b3fa1435c010711876a9229e5cd4192 (patch)
tree156271e1ee5af5f3127c9c1fad4dbfd868a976b4 /time/strftime.c
parentbef248950aa7624e21c404948e8e5a7a3f2b83b7 (diff)
downloadglibc-958d68077b3fa1435c010711876a9229e5cd4192.zip
glibc-958d68077b3fa1435c010711876a9229e5cd4192.tar.gz
glibc-958d68077b3fa1435c010711876a9229e5cd4192.tar.bz2
Update.
1999-12-21 Shinya Hanataka <hanataka@abyss.rim.or.jp> * locale/lc-time.c: Extend structure era_entry. * locale/localeinfo.h: Likewise. * locale/lc-time.c: Handle '-' direction used in locale's era part properly. * time/strptime.c: Likewise. * time/strftime.c: Likewise. * locale/programs/ld-time.c: Consider negative values in era part of locale as B.C.. * time/strptime.c (strptime_internal): Merged Yoshiyama's %E[CyY] implementation. 1999-12-21 Akira Yoshiyama <yosshy@debian.or.jp> * time/strptime.c (strptime_internal): Fix segV bugs of a couple of recursive() call. * time/strptime.c (strptime_internal): Implement `%EC',`%Ey',`%EY' parsing. 1999-12-21 Ulrich Drepper <drepper@cygnus.com> * sysdeps/arm/dl-machine.c (CLEAR_CACHE): Fix a2 value. Patch by Scott Bambrough <scottb@netwinder.org>.
Diffstat (limited to 'time/strftime.c')
-rw-r--r--time/strftime.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/time/strftime.c b/time/strftime.c
index 7de2e84..d53fdfe 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -834,19 +834,11 @@ my_strftime (s, maxsize, format, tp ut_argument)
if (era)
{
# ifdef COMPILE_WIDE
- /* 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;
- tcp = strchr (tcp, '\0') + 1;
- tcp += 3 - (((tcp - era->name_fmt) + 3) & 3);
- ws = (wchar_t *) tcp;
- len = wcslen (ws);
- cpy (len, ws);
+ size_t len = strlen (era->era_name);
+ cpy (len, era->era_name);
# else
- size_t len = strlen (era->name_fmt);
- cpy (len, era->name_fmt);
+ size_t len = strlen (era->era_name);
+ cpy (len, era->era_name);
# endif
break;
}
@@ -1199,15 +1191,9 @@ my_strftime (s, maxsize, format, tp ut_argument)
if (era)
{
# ifdef COMPILE_WIDE
- /* The wide name is after the multi byte name and
- format. */
- char *tcp = strchr (era->name_fmt, '\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;
+ subfmt = era->era_wformat;
# else
- subfmt = strchr (era->name_fmt, '\0') + 1;
+ subfmt = era->era_format;
# endif
goto subformat;
}
@@ -1231,7 +1217,7 @@ my_strftime (s, maxsize, format, tp ut_argument)
{
int delta = tp->tm_year - era->start_date[0];
DO_NUMBER (1, (era->offset
- + (era->direction == '-' ? -delta : delta)));
+ + delta * era->absolute_direction));
}
#else
# if HAVE_STRFTIME