public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC][PATCH v8 08/16] Let alternative month names be a copy of regular ones (bug 10871).
@ 2017-06-28 10:06 Rafal Luzynski
  2017-07-03 21:33 ` Zack Weinberg
  0 siblings, 1 reply; 5+ messages in thread
From: Rafal Luzynski @ 2017-06-28 10:06 UTC (permalink / raw)
  To: libc-alpha

If alt_mon definition is missing from a locale then let it be
a copy of mon array.  Majority of languages do not need this feature
so let us accept the locale definition file without alt_mon and
provide the same content as mon when software requires alt_mon.

[BZ #10871]
* locale/programs/ld-time.c: alternative month names are a copy of
mon if not provided explicitly.
---
 locale/programs/ld-time.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
index 66a9e30..a6bf2b1 100644
--- a/locale/programs/ld-time.c
+++ b/locale/programs/ld-time.c
@@ -960,6 +960,14 @@ time_read (struct linereader *ldfile, struct localedef_t
*result,
 	    lr_error (ldfile, _("\
 %1$s: definition does not end with `END %1$s'"), "LC_TIME");
 	  lr_ignore_rest (ldfile, now->tok == tok_lc_time);
+
+	  /* If alt_mon is missing then let it be a copy of mon.  */
+	  if (!ignore_content && !time->alt_mon_defined)
+	    {
+	      memcpy (time->alt_mon, time->mon, sizeof (time->mon));
+	      memcpy (time->walt_mon, time->wmon, sizeof (time->wmon));
+	      time->alt_mon_defined = 1;
+	    }
 	  return;
 
 	default:
-- 
2.7.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-15  9:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-28 10:06 [RFC][PATCH v8 08/16] Let alternative month names be a copy of regular ones (bug 10871) Rafal Luzynski
2017-07-03 21:33 ` Zack Weinberg
2017-07-03 23:13   ` Joseph Myers
2017-09-15  9:49     ` Rafal Luzynski
2017-07-05  0:12   ` Rafal Luzynski

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).