From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 27 21:00:37 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D6B416A4CF for ; Thu, 27 Jan 2005 21:00:37 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26BC643D48 for ; Thu, 27 Jan 2005 21:00:37 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j0RL0b7a018040 for ; Thu, 27 Jan 2005 21:00:37 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j0RL0axO018039; Thu, 27 Jan 2005 21:00:36 GMT (envelope-from gnats) Resent-Date: Thu, 27 Jan 2005 21:00:36 GMT Resent-Message-Id: <200501272100.j0RL0axO018039@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rostislav Krasny Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3285B16A4CE for ; Thu, 27 Jan 2005 20:59:36 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id F006243D53 for ; Thu, 27 Jan 2005 20:59:35 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0RKxZF5093276 for ; Thu, 27 Jan 2005 20:59:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j0RKxZN0093275; Thu, 27 Jan 2005 20:59:35 GMT (envelope-from nobody) Message-Id: <200501272059.j0RKxZN0093275@www.freebsd.org> Date: Thu, 27 Jan 2005 20:59:35 GMT From: Rostislav Krasny To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/76773: [PATCH] catopen(3) within tcsh(1) uses LANG instead of LC_MESSAGES X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2005 21:00:37 -0000 >Number: 76773 >Category: bin >Synopsis: [PATCH] catopen(3) within tcsh(1) uses LANG instead of LC_MESSAGES >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 27 21:00:36 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Rostislav Krasny >Release: 5.3-RELEASE-p5 >Organization: >Environment: FreeBSD saturn 5.3-RELEASE-p5 FreeBSD 5.3-RELEASE-p5 #0: Mon Jan 17 11:50:06 IST 2005 root@saturn:/usr/obj/usr/src/sys/MYKERNEL i386 >Description: tcsh(1) uses the catopen(3) function to open the message catalog with localized messages. It have following prototype: catopen(const char *name, int oflag); and is called by tcsh(1) only in sh.func.c: catd = catopen(catalog, MCLoadBySet); The MCLoadBySet is defined only in sh.h: # ifndef MCLoadBySet # define MCLoadBySet 0 # endif ===== quote from catopen(3) manual ===== If the oflag argument is set to the NL_CAT_LOCALE constant, LC_MESSAGES locale category used to open the message catalog; using NL_CAT_LOCALE conforms to the X/Open Portability Guide Issue 4 (``XPG4'') standard. You can specify 0 for compatibility with X/Open Portability Guide Issue 3 (``XPG3''); when oflag is set to 0, the LANG environment variable deter- mines the message catalog locale. ===== quote from catopen(3) manual ===== >How-To-Repeat: 1. run csh or tcsh 2. change the LANG environment variable to fr_FR.ISO8859-15 or ru_RU.KOI8-R 3. change LC_MESSAGES environment variable to C 4. run any non-existent command, for example 'gg', and see in what language you get the error message. Just a short example: > locale LANG=fr_FR.ISO8859-15 LC_CTYPE="fr_FR.ISO8859-15" LC_COLLATE="fr_FR.ISO8859-15" LC_TIME="fr_FR.ISO8859-15" LC_NUMERIC="fr_FR.ISO8859-15" LC_MONETARY="fr_FR.ISO8859-15" LC_MESSAGES=C LC_ALL= > gg gg: Commande introuvable. >Fix: --- /usr/src/bin/csh/config.h Sun Jul 11 05:23:38 2004 +++ config.h Thu Jan 27 22:08:22 2005 @@ -130,6 +130,8 @@ /* we want to use the system malloc when we install as /bin/csh */ #define SYSMALLOC #define BSD_STYLE_COLORLS +/* LC_MESSAGES locale category used to open the message catalog */ +#define MCLoadBySet NL_CAT_LOCALE #endif #if defined(__NetBSD__) >Release-Note: >Audit-Trail: >Unformatted: