From owner-freebsd-current Tue Feb 13 0:23:38 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail.rdc1.kt.home.ne.jp (ha2.rdc1.kt.home.ne.jp [203.165.9.243]) by hub.freebsd.org (Postfix) with ESMTP id 9054637B491; Tue, 13 Feb 2001 00:23:30 -0800 (PST) Received: from daemon.local.idaemons.org ([203.165.161.10]) by mail.rdc1.kt.home.ne.jp (InterMail vM.4.01.02.00 201-229-116) with ESMTP id <20010213082329.QJPP19464.mail.rdc1.kt.home.ne.jp@daemon.local.idaemons.org>; Tue, 13 Feb 2001 00:23:29 -0800 Received: by daemon.local.idaemons.org (8.11.1/3.7W) id f1D8NTv61476; Tue, 13 Feb 2001 17:23:29 +0900 (JST) Date: Tue, 13 Feb 2001 17:23:28 +0900 Message-ID: <86y9vbdm9r.wl@daemon.local.idaemons.org> From: "Akinori MUSHA" To: phantom@FreeBSD.org Cc: current@FreeBSD.org Subject: Re: setlocale() fails In-Reply-To: <86zofrmtk4.wl@archon.local.idaemons.org> References: <86zofrmtk4.wl@archon.local.idaemons.org> User-Agent: Wanderlust/2.5.4 (Smooth) SEMI/1.14.0 (Iburihashi) FLIM/1.14.0 (Ninokuchi) APEL/10.2 MULE XEmacs/21.1 (patch 12) (Channel Islands) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.0 - "Iburihashi") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi again, At Tue, 13 Feb 2001 07:21:15 +0900, I wrote: > I found that setlocale() always fails on -current. > > #include > #include > > int main() > { > if (setlocale(LC_ALL, "")) > puts("ok"); > else > puts("failed"); > return 0; > } > > This program shows "failed" on -current regardless of the value of > LANG unless it's other than "C", when it shows "ok" on -stable... > > Any ideas? I found the culprit. Here is a patch which fixes the problem. Index: lmessages.c =================================================================== RCS file: /home/ncvs/src/lib/libc/locale/lmessages.c,v retrieving revision 1.4 diff -u -r1.4 lmessages.c --- lmessages.c 2001/02/12 08:56:39 1.4 +++ lmessages.c 2001/02/13 08:19:04 @@ -55,7 +55,7 @@ ret = __part_load_locale(name, &_messages_using_locale, messages_locale_buf, "LC_MESSAGES", LCMESSAGES_SIZE_FULL, (const char **)&_messages_locale); - if (ret == 0) { + if (ret != 0) { /* Assume that we have incomplete locale file (without * "yesstr" and "nostr" declared. Try it also. */ -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "We're only at home when we're on the run, on the wing, on the fly" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message