From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D021D3858C31 for ; Wed, 26 Apr 2023 12:24:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D021D3858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682511850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bWGwYhXaNEe0fDoKxMUYlci0doB9PR1AlhH/byzy7SY=; b=FDDLbJE7KJZsy+sWSH0RKL59J1L6BhPeb4nGn5GmiAV2e92vnQdUSJ7Tz6ezwf/iy75MHD bCgu0R/+3UJrjyTuwrWJJHzgc6fYGtAuG5vLM6molMiwTuIhV9R2culdSshIetCxBd7al8 xpb2mbMWO/R/DLo4p1Q79pROhUtzjxg= 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-584-_Bq7Wb7BNzC3dLq72eiKGw-1; Wed, 26 Apr 2023 08:24:07 -0400 X-MC-Unique: _Bq7Wb7BNzC3dLq72eiKGw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2DDA4885620; Wed, 26 Apr 2023 12:24:07 +0000 (UTC) Received: from Nymeria-redhat.redhat.com (unknown [10.39.193.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9647F40C2064; Wed, 26 Apr 2023 12:24:06 +0000 (UTC) From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= To: libc-alpha@sourceware.org Cc: siddhesh@gotplt.org Subject: [PATCH v2] locale/programs/locarchive.c: Remove unnecessary check in add_locale_archive Date: Wed, 26 Apr 2023 14:23:49 +0200 Message-Id: <20230426122349.922467-1-fberat@redhat.com> In-Reply-To: <20230426121033.921725-1-fberat@redhat.com> References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.2 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 List-Id: Changes since v1: - Rebased on master --8<-- Since asprintf is called "if (mask & XPG_NORM_CODESET)" there is no point in checking the mask again within the asprintf call. --- 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 87d2d9b1b2..8d7d51af6c 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. */ 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 ?: ""); /* This call does the main work. */ -- 2.40.0