public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Frédéric Bérat" <fberat@redhat.com>
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	[thread overview]
Message-ID: <20230426121033.921725-1-fberat@redhat.com> (raw)

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 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);
-- 
2.39.2


             reply	other threads:[~2023-04-26 12:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 12:10 Frédéric Bérat [this message]
2023-04-26 12:12 ` Siddhesh Poyarekar
2023-04-26 12:17   ` Siddhesh Poyarekar
2023-04-26 12:23 ` [PATCH v2] " Frédéric Bérat
2023-04-26 12:29   ` Siddhesh Poyarekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230426121033.921725-1-fberat@redhat.com \
    --to=fberat@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@gotplt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).