NetBSD Problem Report #8730
Received: (qmail 23049 invoked from network); 1 Nov 1999 21:49:46 -0000
Message-Id: <199911012143.WAA02640@goro.campus.luth.se>
Date: Mon, 1 Nov 1999 22:43:19 +0100 (CET)
From: jnilsson@ludd.luth.se
Reply-To: jnilsson@ludd.luth.se
To: gnats-bugs@gnats.netbsd.org
Subject: use locales in /bin/ls
X-Send-Pr-Version: 3.95
>Number: 8730
>Category: bin
>Synopsis: use locales in /bin/ls
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: jdolecek
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Nov 01 13:51:00 +0000 1999
>Closed-Date: Wed Nov 03 03:58:28 +0000 1999
>Last-Modified: Tue Sep 04 23:24:15 +0000 2001
>Originator: Jens A Nilsson
>Release: NetBSD-current 1999-11-01
>Organization:
>Environment:
System: NetBSD goro 1.4M NetBSD 1.4M (GORO) #0: Wed Oct 27 21:47:27 CEST 1999 jens@goro:/amd/subzero2/root/net/subzero/usr/src/sys/arch/alpha/compile/GORO alpha
>Description:
A call to setlocale will allow /bin/ls to use locales
>How-To-Repeat:
>Fix:
The patch below.
--- ls.c 1999/05/17 12:16:03 1.38
+++ ls.c 1999/11/01 21:46:30
@@ -58,6 +58,7 @@
#include <err.h>
#include <errno.h>
#include <fts.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -118,6 +119,8 @@
int ch, fts_options, notused;
int kflag = 0;
const char *p;
+
+ setlocale(LC_ALL, "");
/* Terminal defaults to -Cq, non-terminal defaults to -1. */
if (isatty(STDOUT_FILENO)) {
>Release-Note:
>Audit-Trail:
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: jnilsson@ludd.luth.se
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8730: use locales in /bin/ls
Date: Tue, 2 Nov 1999 02:31:01 +0100 (MET)
On Mon, 1 Nov 1999 jnilsson@ludd.luth.se wrote:
> >Description:
> A call to setlocale will allow /bin/ls to use locales
> >How-To-Repeat:
Well, you didn't give a non-working case ?
the /bin/ls shipped with 1.4 works fine for me:
miyu% setenv LANG de
miyu% ls /bla
ls: /bla: Datei oder Verzeichnis nicht gefunden
I've tried your patch, and it doesn't make any change. What am I missing
here?
- Hubert
--
NetBSD - Better for your uptime than Viagra
State-Changed-From-To: open->analyzed
State-Changed-By: jdolecek
State-Changed-When: Tue Nov 2 02:38:13 PST 1999
State-Changed-Why:
I'm going to scan whole tree and add initialization of locales as appropriate.
It should happen in next couple of days.
Responsible-Changed-From-To: bin-bug-people->jdolecek
Responsible-Changed-By: jdolecek
Responsible-Changed-When: Tue Nov 2 02:38:13 PST 1999
Responsible-Changed-Why:
I'll take care of this.
State-Changed-From-To: analyzed->closed
State-Changed-By: hubertf
State-Changed-When: Tue Nov 2 19:58:28 PST 1999
State-Changed-Why:
After discussion with the PRs submitter, it was found out that
this patch only works with a modified libc and is worthless without.
It's been agreed to close the PR.
- Hubert
P.S.: Jaromir, maybe ask Jens directly what the deal involved is.
Klaus Klein may have an opinion there, too.
From: Jaromir Dolecek <dolecek@ics.muni.cz>
To: hubertf@netbsd.org
Cc: jnilsson@ludd.luth.se, jdolecek@netbsd.org
Subject: Re: bin/8730
Date: Wed, 3 Nov 1999 10:16:38 +0100 (MET)
hubertf@netbsd.org wrote:
> After discussion with the PRs submitter, it was found out that
> this patch only works with a modified libc and is worthless without.
> It's been agreed to close the PR.
Actually, this patch is also good when one has hacked together
working locale file (like, e.g., me). However, for it to actually
work, one needs fixed libc (i.e. -current) - the old one had
setlocale() broken in that it never actually loaded the LC_CTYPE
file if respective LC_COLLATE locale has not been also present. I
can send you a patch, Jen, if ya want to.
Hmm, reminds me I should request a pullup of the change ...
At the time, I also used patched libc, so that the "default" table
is iso-8859-2 one. I dropped it after a while, as it was too of
pain to maintain it :-/
The setlocale() call should be added to all programs in tree which
use isprint() & frinds or libedit (or maybe all programs) - once
we will have working locales (Klaus is working on it, BTW), this
is required for locales to actually work.
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.ics.muni.cz/~dolecek/
"The only way how to get rid temptation is to yield to it." -- Oscar Wilde
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.