From patchwork Mon May 29 09:21:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafal Luzynski X-Patchwork-Id: 768106 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wbrq55VQVz9s7M for ; Mon, 29 May 2017 19:22:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Lg/m2Xdj"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:to:message-id:subject :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=N/N7nA8o0k2HNsYRBSOpvaCVk57ZPp6Nr9s6ofUzGWWYYiRxHKBmo y1XAAEV/4skbfbLf7gbuLxO7/uIWGeNFiMy9ybcw8PH/j8lC5nXERoyfOVMF4xre QxEbxB/VrqOUgVIHXl0cBDFWnQVy1ZsBhzSh67j3GfUz/TF/5/7hNg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:to:message-id:subject :mime-version:content-type:content-transfer-encoding; s=default; bh=sH3S5yt3GM41BTYUqE6S+cr5Tco=; b=Lg/m2XdjKv9E8cmyF5vac7B43EDL WXrntyeF3UnaWl+4IhcouEZVsYSZG6L5l1E8aNEbvGDNFF9HdyTeXnzUyHOh4Lar tymf1c4cneppTortNHjlLwqGPE4uIGhr/oxBqHEiWUsCRCfiqigz70y0bX1aqtAD k9i+KZfAf8T/UNU= Received: (qmail 107609 invoked by alias); 29 May 2017 09:21:56 -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 107592 invoked by uid 89); 29 May 2017 09:21:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.6 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=1s, month, H*x:Mailer, H*UA:Mailer X-HELO: aev204.rev.netart.pl X-Spam-Score: 0 Date: Mon, 29 May 2017 11:21:55 +0200 (CEST) From: Rafal Luzynski Reply-To: Rafal Luzynski To: libc-alpha@sourceware.org Message-ID: <249611570.905512.1496049715386@poczta.nazwa.pl> Subject: [RFC][PATCH v7 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;