From patchwork Thu Nov 23 11:17:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Yano X-Patchwork-Id: 80633 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD81B3857BB0 for ; Thu, 23 Nov 2023 11:18:28 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dmta0016.nifty.com (mta-snd00004.nifty.com [106.153.226.36]) by sourceware.org (Postfix) with ESMTPS id F19723858C20 for ; Thu, 23 Nov 2023 11:18:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F19723858C20 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F19723858C20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=106.153.226.36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700738299; cv=none; b=ZoKkr7XKy2ABBpv5ldWuisrYYtJtxfYpLDIu1rCT0xKm+daKqMWCXuj8Lyk5DVKtbjHNcsc5fO17utnj0TdGIVAxOFsOOlibTGhUHPbx1/LlMnedoXWkv7C0GPZFUTjaQhgYVdITku3MB5c9BvfVIML6tfb2KZ6nQuEExstWBlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700738299; c=relaxed/simple; bh=ApY0v2hTaQ1rIMcm7pdMY7u46mB0ZO92EGXDaG1FOU4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=TL7kapD2Hqrc2YkgXhMiu1kpCOfttcdi5muRXfKf9XhOnxxcn1xawtQM5u8JqWzOp1ZhJhKn9mDQ8Rd6OrKq9P5yUib1Qg0B51JzKuKI3Vxb5486HZBvDoN3K62a8faWMkuh+B1PJYLrpg8IMauxLk5b7E+n8jezMriBp9qx86g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost.localdomain by dmta0016.nifty.com with ESMTP id <20231123111812617.LDYL.28881.localhost.localdomain@nifty.com>; Thu, 23 Nov 2023 20:18:12 +0900 From: Takashi Yano To: newlib@sourceware.org Cc: Takashi Yano Subject: [PATCH] newlib: ln_langinfo: Fix a bug of time stuff. Date: Thu, 23 Nov 2023 20:17:55 +0900 Message-Id: <20231123111755.6188-1-takashi.yano@nifty.ne.jp> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces+patchwork=sourceware.org@sourceware.org Previsouly, e.g. nl_langinfo(_NL_TIME_WMONT_1) returns "February" due to the bug. Similarly, nl_langinfo(_LN_TIME_WWDAY_1) returns "Mon". This patch fixes that. Reviewed-by: Signed-off-by: --- newlib/libc/locale/nl_langinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c index aaa1aef86..c34a7d131 100644 --- a/newlib/libc/locale/nl_langinfo.c +++ b/newlib/libc/locale/nl_langinfo.c @@ -78,6 +78,7 @@ static struct _nl_item_t _NLITEM (ctype, woutdigits[8]), _NLITEM (ctype, woutdigits[9]), _NLITEM (time, codeset), + _NLITEM (time, wmon[0]), _NLITEM (time, wmon[1]), _NLITEM (time, wmon[2]), _NLITEM (time, wmon[3]), @@ -89,7 +90,7 @@ static struct _nl_item_t _NLITEM (time, wmon[9]), _NLITEM (time, wmon[10]), _NLITEM (time, wmon[11]), - _NLITEM (time, wmon[12]), + _NLITEM (time, wmonth[0]), _NLITEM (time, wmonth[1]), _NLITEM (time, wmonth[2]), _NLITEM (time, wmonth[3]), @@ -101,21 +102,20 @@ static struct _nl_item_t _NLITEM (time, wmonth[9]), _NLITEM (time, wmonth[10]), _NLITEM (time, wmonth[11]), - _NLITEM (time, wmonth[12]), + _NLITEM (time, wwday[0]), _NLITEM (time, wwday[1]), _NLITEM (time, wwday[2]), _NLITEM (time, wwday[3]), _NLITEM (time, wwday[4]), _NLITEM (time, wwday[5]), _NLITEM (time, wwday[6]), - _NLITEM (time, wwday[7]), + _NLITEM (time, wweekday[0]), _NLITEM (time, wweekday[1]), _NLITEM (time, wweekday[2]), _NLITEM (time, wweekday[3]), _NLITEM (time, wweekday[4]), _NLITEM (time, wweekday[5]), _NLITEM (time, wweekday[6]), - _NLITEM (time, wweekday[7]), _NLITEM (time, wX_fmt), _NLITEM (time, wx_fmt), _NLITEM (time, wc_fmt),