Subject: bin/8730: use locales in /bin/ls
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jnilsson@ludd.luth.se>
List: netbsd-bugs
Date: 11/01/1999 13:51:51
>Number:         8730
>Category:       bin
>Synopsis:       use locales in /bin/ls
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Nov  1 13:51:00 1999
>Last-Modified:
>Originator:     Jens A Nilsson <jnilsson@ludd.luth.se>
>Organization:
>Release:        NetBSD-current 1999-11-01
>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)) {
>Audit-Trail:
>Unformatted: