bin/140499: teach perror(1) about localization

Edwin Groothuis edwin at
Thu Nov 12 07:00:09 UTC 2009

>Number:         140499
>Category:       bin
>Synopsis:       teach perror(1) about localization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 12 07:00:09 UTC 2009
>Originator:     Edwin Groothuis
>Release:        FreeBSD 8.0-RC1 i386
System: FreeBSD 8.0-RC1 FreeBSD 8.0-RC1 #1 r197608: Tue Sep 29 12:34:13 EST 2009 edwin at i386


[~/svn/svn-head/usr.bin/perror] edwin at vaio>LANG=nl_NL.ISO8859-1 perror 2
No such file or directory

[~/svn/svn-head/usr.bin/perror] edwin at vaio>LANG=nl_NL.ISO8859-1 ./perror 2
Bestand of map niet gevonden


gnn@: feel free to reassign to edwin@ if approved.

Index: perror.c
--- perror.c    (revision 199198)
+++ perror.c    (working copy)
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <err.h>
+#include <locale.h>
 #include <sys/errno.h>

 static void usage(void);
@@ -43,6 +44,7 @@
        char *errstr;
        long errnum;

+       (void) setlocale(LC_MESSAGES, "");
        if (argc != 2)


More information about the freebsd-bugs mailing list