From patchwork Mon Mar 20 20:41:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafal Luzynski X-Patchwork-Id: 19670 Received: (qmail 93254 invoked by alias); 20 Mar 2017 20:41:28 -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 92854 invoked by uid 89); 20 Mar 2017 20:41:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=time, month, H*x:Mailer, H*UA:Mailer X-HELO: aev204.rev.netart.pl X-Spam-Score: 0 Date: Mon, 20 Mar 2017 21:41:25 +0100 (CET) From: Rafal Luzynski Reply-To: Rafal Luzynski To: libc-alpha@sourceware.org Message-ID: <1964062218.88237.1490042485800@poczta.nazwa.pl> Subject: [RFC][PATCH v6 08/16] Let alternative month names be a copy of regular ones (bug 10871). MIME-Version: 1.0 X-Originating-Client: com.openexchange.ox.gui.dhtml 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(+) default: 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;