| 1 |
diff -up man-1.6f/src/gripes.c.loc man-1.6f/src/gripes.c
|
| 2 |
--- man-1.6f/src/gripes.c.loc 2008-06-09 14:15:14.000000000 +0200
|
| 3 |
+++ man-1.6f/src/gripes.c 2008-06-09 14:20:32.000000000 +0200
|
| 4 |
@@ -1,6 +1,7 @@
|
| 5 |
#include <stdio.h>
|
| 6 |
#include <stdarg.h>
|
| 7 |
#include <stdlib.h>
|
| 8 |
+#include <locale.h>
|
| 9 |
|
| 10 |
#include "gripes.h"
|
| 11 |
#include "man.h" /* for progname */
|
| 12 |
@@ -36,6 +37,8 @@ int cat_is_open = 0;
|
| 13 |
static void
|
| 14 |
catinit (void) {
|
| 15 |
if (!cat_is_open) {
|
| 16 |
+ setenv("NLSPATH","/usr/share/locale/%l/LC_MESSAGES/%N",0);
|
| 17 |
+ setlocale(LC_ALL, "");
|
| 18 |
#ifdef NL_CAT_LOCALE
|
| 19 |
catfd = my_catopen(mantexts,NL_CAT_LOCALE);
|
| 20 |
#else
|
| 21 |
@@ -49,11 +52,11 @@ catinit (void) {
|
| 22 |
*/
|
| 23 |
char *s, *lg;
|
| 24 |
s = getenv("NLSPATH");
|
| 25 |
- lg = getenv("LANG");
|
| 26 |
+ lg = getenv("LC_ALL");
|
| 27 |
if (!lg)
|
| 28 |
lg = getenv("LC_MESSAGES");
|
| 29 |
if (!lg)
|
| 30 |
- lg = getenv("LC_ALL");
|
| 31 |
+ lg = getenv("LANG");
|
| 32 |
if (lg && strncmp(lg, "en", 2) && strcmp(lg, "C") && strcmp(lg, "POSIX")) {
|
| 33 |
fprintf(stderr,
|
| 34 |
"Cannot open the message catalog \"%s\" for locale \"%s\"\n"
|