From patchwork Wed Apr 26 12:10:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Berat X-Patchwork-Id: 1774081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=yUT9/AZ5; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5yQq4bG6z23td for ; Wed, 26 Apr 2023 22:11:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ECF70385840E for ; Wed, 26 Apr 2023 12:11:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECF70385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682511105; bh=iC23lqw0Bt8ctEP0+d/WK1UP0rNtk6DKCRxIQuffcnE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=yUT9/AZ5ady1LuYJK03EAbMUS8SJKci2AhvO96nYv7EfL++3IhAdPdrYx5rqNTLI/ CeCZGtOpf6wu2X+qoh7P9UU+VV5uIpWdMLsm1Z1HHWQM30hXDhy+WaiygNQCzOCEP/ i/OI+Z3fgSWl9nnIacJlIa00Xg89fv6S80gqMGjE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4D9123858C53 for ; Wed, 26 Apr 2023 12:11:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D9123858C53 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-217-n6HvifmlMvmvi1q5TCLrig-1; Wed, 26 Apr 2023 08:11:01 -0400 X-MC-Unique: n6HvifmlMvmvi1q5TCLrig-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C562811E7C; Wed, 26 Apr 2023 12:10:45 +0000 (UTC) Received: from Nymeria-redhat.redhat.com (unknown [10.39.193.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE7CB40C6E68; Wed, 26 Apr 2023 12:10:44 +0000 (UTC) To: libc-alpha@sourceware.org Cc: siddhesh@gotplt.org Subject: [PATCH] locale/programs/locarchive.c: Remove unnecessary check in add_locale_archive Date: Wed, 26 Apr 2023 14:10:33 +0200 Message-Id: <20230426121033.921725-1-fberat@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Fr=C3=A9d=C3=A9ric_B=C3=A9rat_via_Libc-alpha?= From: Frederic Berat Reply-To: =?utf-8?b?RnLDqWTDqXJpYyBCw6lyYXQ=?= Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Since asprintf is called "if (mask & XPG_NORM_CODESET)" there is no point in checking the mask again within the asprintf call. Reviewed-by: Siddhesh Poyarekar --- locale/programs/locarchive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c index f8c6f79afa..71fd9f34fa 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c @@ -1156,7 +1156,7 @@ add_locale_to_archive (struct locarhandle *ah, const char *name, We will store it in the archive with a normalized name. */ if (asprintf (&normalized_name, "%s%s%s.%s%s%s", language, territory == NULL ? "" : "_", territory ?: "", - (mask & XPG_NORM_CODESET) ? normalized_codeset : codeset, + normalized_codeset, modifier == NULL ? "" : "@", modifier ?: "") < 0) { free ((char *) normalized_codeset);