public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] localedef: change week_1stweek default to 7
@ 2016-04-16  7:26 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2016-04-16  7:26 UTC (permalink / raw)
  To: libc-alpha

The ISO 14652/30112 specs say the defaults for the week keyword are:
	7, 19971130, 7

The localedef has been using those defaults for the first two, but
0 for the last one.
---
 locale/programs/ld-time.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
index ca31c9c..87531bc 100644
--- a/locale/programs/ld-time.c
+++ b/locale/programs/ld-time.c
@@ -487,12 +487,16 @@ No definition for %s category found"), "LC_TIME"));
 	}
     }
 
+  /* Set up defaults based on ISO 30112 WD10 [2014].  */
   if (time->week_ndays == 0)
     time->week_ndays = 7;
 
   if (time->week_1stday == 0)
     time->week_1stday = 19971130;
 
+  if (time->week_1stweek == 0)
+    time->week_1stweek = 7;
+
   if (time->week_1stweek > time->week_ndays)
     WITH_CUR_LOCALE (error (0, 0, _("\
 %s: third operand for value of field `%s' must not be larger than %d"),
-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-16  7:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-16  7:26 [PATCH] localedef: change week_1stweek default to 7 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).