about summary refs log tree commit diff
path: root/time/tst-strftime2.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* ja_JP locale: Add entry for the new Japanese era [BZ #22964]TAMUKI Shoichi2019-04-021-5/+8
| | | | | | | | | | | | | | | | | | | | The Japanese era name will be changed on May 1, 2019. The Japanese government made a preliminary announcement on April 1, 2019. The glibc ja_JP locale must be updated to include the new era name for strftime's alternative year format support. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> ChangeLog: [BZ #22964] * localedata/locales/ja_JP (LC_TIME): Add entry for the new Japanese era. * time/tst-strftime2.c (dates): Add 2019-04-30 and 2019-05-01. (mkreftable): Add rules for the new Japanese era and the new dates.
* time: Add tests for Minguo calendar [BZ #24293]TAMUKI Shoichi2019-04-021-7/+34
| | | | | | | | | | | | | | | Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com> ChangeLog: [BZ #24293] * time/Makefile (LOCALES): Add zh_TW.UTF-8, cmn_TW.UTF-8, hak_TW.UTF-8, nan_TW.UTF-8, and lzh_TW.UTF-8. * time/tst-strftime2.c (locales): Likewise. (dates): Add 1910-04-01, 1911-12-31, 1912-01-01, 1913-04-01, 2010-04-01, and 2011-04-01. (mkreftable): Add rules for the new locales and the new dates.
* time/tst-strftime2.c: Make the file easier to maintainTAMUKI Shoichi2019-04-021-40/+73
| | | | | | | | | | | | | | | | | | | | | | Express the years as full Gregorian years (e.g., 1988 instead of 88) and months with natural numbers (1-12 rather than 0-11). Compare actual dates rather than indexes when selecting the era name. Declare the local variable era as a string character pointer rather than an array of chars where the actual string is copied which might lead to potential buffer overflows in future. Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com> ChangeLog: * time/tst-strftime2.c (date_t): Explicitly define the type. (dates): Use natural month and year numbers to express a date. (is_before): New function to compare dates. (mkreftable): Minor improvements to simplify maintenance. (do_test): Reflect the changes in dates array.
* tst-strftime2: Use array_length macros instead of magic numbersTAMUKI Shoichi2019-02-081-1/+2
| | | | | | | ChangeLog: * time/tst-strftime2.c: Use array_length macros instead of magic numbers.
* strftime: Pass the additional flags from "%EY" to "%Ey" [BZ #24096]TAMUKI Shoichi2019-01-241-0/+132
The full representation of the alternative calendar year (%EY) typically includes an internal use of "%Ey". As a GNU extension, apply any flags on "%EY" (e.g. "%_EY", "%-EY") to the internal "%Ey", allowing users of "%EY" to control how the year is padded. Reviewed-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Zack Weinberg <zackw@panix.com> ChangeLog: [BZ #24096] * manual/time.texi (strftime): Document "%EC" and "%EY". * time/Makefile (tests): Add tst-strftime2. (LOCALES): Add ja_JP.UTF-8, lo_LA.UTF-8, and th_TH.UTF-8. * time/strftime_l.c (__strftime_internal): Add argument yr_spec to override padding for "%Ey". If an optional flag ('_' or '-') is specified to "%EY", interpret the "%Ey" in the subformat as if decorated with that flag. * time/tst-strftime2.c: New file.