From patchwork Mon Mar 20 20:44:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafal Luzynski X-Patchwork-Id: 741182 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 3vn7GV07Gvz9rvt for ; Tue, 21 Mar 2017 07:44:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="yfjvDGw1"; 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=Ov/RhD+O9rio4PBC7+wxdh4YMOJvmTKZ3RB0MDbg1tNVp5s6O9B62 7opBusdwy1ugDgNMZvQTS2Fc7h2A/FiKowhNOV/1RZ9pOSOlGqkj/4zXptou42es a9FPWuVqa252my8tszhgrdaqOmGUW/qsElBXoc1OZjHBLvF4EWUptg= 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=M9ZyfG0Wsmwyqd9O8BeErnURRM0=; b=yfjvDGw1k3e67DM3gYgiYeCVeigo Y2QC/lC4SSH7alBu/cbaxgxlpGGLvEqLCHmdZN4zPf6JrwbsuwY5Dd8XSI62mlbh wDVPawTqvFLBdz/ZNpstYGKe5+E8nUrggeg+fP+/Tk9BqzlbB0OvWo5l74zrK7nC UKnrJNbZ1UhhFUY= Received: (qmail 3391 invoked by alias); 20 Mar 2017 20:44:08 -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 3373 invoked by uid 89); 20 Mar 2017 20:44:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.5 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=7878, month X-HELO: aev204.rev.netart.pl X-Spam-Score: 0 Date: Mon, 20 Mar 2017 21:44:02 +0100 (CET) From: Rafal Luzynski Reply-To: Rafal Luzynski To: libc-alpha@sourceware.org Message-ID: <1692424082.88308.1490042642701@poczta.nazwa.pl> Subject: [RFC][PATCH v6 10/16] Backward compatibility for abbreviated alt. names (bug 10871). MIME-Version: 1.0 X-Originating-Client: com.openexchange.ox.gui.dhtml All the previous changes related with backward compatibility also repeated to support abbreviated alternative month names. [BZ #10871] * locale/nl_langinfo_l.c: backward compatibility for _NL_[W]ABALTMON. * time/strftime_l.c: backward compatibility for %Ob. --- locale/nl_langinfo_l.c | 14 +++++++++++++- time/strftime_l.c | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) cpy (am_len, a_month); diff --git a/locale/nl_langinfo_l.c b/locale/nl_langinfo_l.c index 467a341..c38d190 100644 --- a/locale/nl_langinfo_l.c +++ b/locale/nl_langinfo_l.c @@ -81,7 +81,9 @@ attribute_compat_text_section __nl_langinfo_noaltmon_l (nl_item item, __locale_t l) { if ((item >= ALTMON_1 && item <= ALTMON_12) - || (item >= _NL_WALTMON_1 && item <= _NL_WALTMON_12)) + || (item >= _NL_WALTMON_1 && item <= _NL_WALTMON_12) + || (item >= _NL_ABALTMON_1 && item <= _NL_ABALTMON_12) + || (item >= _NL_WABALTMON_1 && item <= _NL_WABALTMON_12)) /* Pretend it's a bogus index for this category: bogus item. */ return (char *) ""; else if (item >= MON_1 && item <= MON_12) @@ -94,6 +96,16 @@ __nl_langinfo_noaltmon_l (nl_item item, __locale_t l) /* The same for _NL_WALTMON_... and _NL_WMON_... */ return __nl_langinfo_l (item + _NL_WALTMON_1 - _NL_WMON_1, l); } + else if (item >= ABMON_1 && item <= ABMON_12) + { + /* _NL_ABALTMON... item contains what ABMON_... item contained before. */ + return __nl_langinfo_l (item + _NL_ABALTMON_1 - ABMON_1, l); + } + else if (item >= _NL_WABMON_1 && item <= _NL_WABMON_12) + { + /* The same for _NL_WABALTMON_... and _NL_WABMON_... */ + return __nl_langinfo_l (item + _NL_WABALTMON_1 - _NL_WABMON_1, l); + } /* Default result if it is not a month. */ return __nl_langinfo_l (item, l); diff --git a/time/strftime_l.c b/time/strftime_l.c index 2353ec8..0141144 100644 --- a/time/strftime_l.c +++ b/time/strftime_l.c @@ -787,8 +787,10 @@ __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format, } if (modifier == L_('E')) goto bad_format; + if (!feature_OB && modifier == L_('O')) + goto bad_format; #if defined _NL_CURRENT || !HAVE_STRFTIME - if (modifier == L_('O')) + if (!feature_OB || modifier == L_('O')) cpy (aam_len, a_altmonth); else