From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id A2747385C6DE; Tue, 12 Dec 2023 09:08:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2747385C6DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702372110; bh=4pgat00EOvVRIgsnQiwVDEI0byCQBzHQYuc/wt1i64s=; h=From:To:Subject:Date:From; b=g8WjWfTZeYrb3xo+OEhu6yOu1R9yrkQot9sOGHaXkSamhTP/2h7nm2L9NQUgPTaeG 3jDphx4No5mUTBLsEt0nXcVGISa3W1T2nn9MI2SiZrQwp+mLS95/cSHMTBBCpenxDJ qfTiTm2jsZ70s92PNnOat54DUddMLV5XsCpIindA= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] intl: Treat C.UTF-8 locale like C locale, part 2 (BZ# 16621) X-Act-Checkin: glibc X-Git-Author: Bruno Haible X-Git-Refname: refs/heads/master X-Git-Oldrev: fc039ce8502d236f11074eb58468be24b4fa8cc7 X-Git-Newrev: d0aefec49941cf6d97e2244d6aa20bafc26d5942 Message-Id: <20231212090830.A2747385C6DE@sourceware.org> Date: Tue, 12 Dec 2023 09:08:30 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d0aefec49941cf6d97e2244d6aa20bafc26d5942 commit d0aefec49941cf6d97e2244d6aa20bafc26d5942 Author: Bruno Haible Date: Tue Dec 12 09:45:16 2023 +0100 intl: Treat C.UTF-8 locale like C locale, part 2 (BZ# 16621) The previous commit was incomplete: gettext() still returns a translation if the file /usr/share/locale/C/LC_MESSAGES/.mo exists. This patch prohibits the translation also in this case. * gettext-runtime/intl/dcigettext.c (DCIGETTEXT): Treat C. locale like the C locale. Reviewed-by: Florian Weimer Diff: --- intl/dcigettext.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/intl/dcigettext.c b/intl/dcigettext.c index 27063886d2..fb69bbf94b 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -691,9 +691,10 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, continue; } - /* If the current locale value is C (or POSIX) we don't load a - domain. Return the MSGID. */ - if (strcmp (single_locale, "C") == 0 + /* If the current locale value is "C" or "C." or "POSIX", + we don't load a domain. Return the MSGID. */ + if ((single_locale[0] == 'C' + && (single_locale[1] == '\0' || single_locale[1] == '.')) || strcmp (single_locale, "POSIX") == 0) break;