From patchwork Sun Jan 6 06:34:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TAMUKI Shoichi X-Patchwork-Id: 30972 Received: (qmail 103353 invoked by alias); 6 Jan 2019 06:36:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 103253 invoked by uid 89); 6 Jan 2019 06:36:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=BAYES_20, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=May, pad, reign, trouble X-HELO: mail.linet.jp Message-Id: <201901060634.AA04158@tamuki.linet.gr.jp> From: TAMUKI Shoichi Date: Sun, 06 Jan 2019 15:34:01 +0900 To: libc-alpha@sourceware.org Subject: [PATCH v5 2/5] strftime: Set the default width of "%Ey" to 2 [BZ #23758] In-Reply-To: <201901060628.AA04156@tamuki.linet.gr.jp> References: <201901060628.AA04156@tamuki.linet.gr.jp> MIME-Version: 1.0 The Japanese era name is scheduled to be changed on May 1, 2019. Prior to this, change the alternative representation for year in strftime to pad the number with zero to keep it constant width, so that prevent the trouble we saw in the past from becoming obvious again from the year after the era name changes onward. Since only one Japanese era name is used by each emperor's reign as lately, it is rare that the year ends in one digit or lasts more than three digits. In addition, the default width of month, day, hour, minute, and second is 2, so adjust the default width of year the same as them, and then the whole display balance is improved. Therefore, it would be reasonable to set the default width padding with zero of "%Ey" to 2. ChangeLog: [BZ #23758] * time/strftime_l.c (__strftime_internal): Set the default width padding with zero of "%Ey" to 2. --- time/strftime_l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/strftime_l.c b/time/strftime_l.c index 7ba4179de3e..cbe08e7afb4 100644 --- a/time/strftime_l.c +++ b/time/strftime_l.c @@ -1294,7 +1294,7 @@ __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format, if (era) { int delta = tp->tm_year - era->start_date[0]; - DO_NUMBER (1, (era->offset + DO_NUMBER (2, (era->offset + delta * era->absolute_direction)); } #else