Patchwork [v5,2/5] strftime: Set the default width of "%Ey" to 2 [BZ #23758]

login
register
mail settings
Submitter TAMUKI Shoichi
Date Jan. 6, 2019, 6:34 a.m.
Message ID <201901060634.AA04158@tamuki.linet.gr.jp>
Download mbox | patch
Permalink /patch/30972/
State New
Headers show

Comments

TAMUKI Shoichi - Jan. 6, 2019, 6:34 a.m.
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(-)
Rafal Luzynski - Jan. 9, 2019, 10:07 a.m.
This patch is actually just a one-liner and it fixes the problem.
I would prefer if the patch 5/5 was split and the documentation
relating to the width of %Ey was merged with this patch and pushed
together but we can also push it now and work on the documentation
later.

Siddhesh (CC:), are you OK to push this patch now and work on
the documentation later?

Other people are welcome to review the commit comment and provide
feedback related with the language correctness.

Regards,

Rafal
Siddhesh Poyarekar - Jan. 9, 2019, 10:25 a.m.
On 09/01/19 3:37 PM, Rafal Luzynski wrote:
> This patch is actually just a one-liner and it fixes the problem.
> I would prefer if the patch 5/5 was split and the documentation
> relating to the width of %Ey was merged with this patch and pushed
> together but we can also push it now and work on the documentation
> later.
> 
> Siddhesh (CC:), are you OK to push this patch now and work on
> the documentation later?

Patch is OK for inclusion in 2.29, but please push it with the 
documentation; we don't want a situation where a flag is in but not the 
documentation.

Siddhesh
Rafal Luzynski - Jan. 9, 2019, 11:02 p.m.
9.01.2019 11:25 Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
> [...]
> Patch is OK for inclusion in 2.29, but please push it with the 
> documentation; we don't want a situation where a flag is in but not the 
> documentation.

That means: please don't push this patch nor anything else (except the patch
1/5, as I mentioned in the previous email).  We need to work on the
documentation first and push only when everything is ready.

Regards,

Rafal
TAMUKI Shoichi - Jan. 10, 2019, 12:44 a.m.
Hello Rafal,

From: Rafal Luzynski <digitalfreak@lingonborough.com>
Subject: Re: [PATCH v5 2/5] strftime: Set the default width of "%Ey" to 2 [BZ #23758]
Date: Wed, 9 Jan 2019 11:07:32 +0100 (CET)

> This patch is actually just a one-liner and it fixes the problem.
> I would prefer if the patch 5/5 was split and the documentation
> relating to the width of %Ey was merged with this patch and pushed
> together but we can also push it now and work on the documentation
> later.

As Siddhesh mentioned, I will revise the patch to include the
documentation.

Regards,
TAMUKI Shoichi

Patch

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