Browse Source

The only thing that was translated into multiple languages in OpenBSD

are the errno messages and signal names.  Everything else is in
English.  We are not planning to translate more text.  Running a
mixed system with less than 1% of the text in native language makes
no sense.  So remove the NLS support from libc messages.  The
catopen(3) functions stay as they are.
OK stsp@ mpi@
OPENBSD_5_9
bluhm 9 years ago
parent
commit
513918fc5d
1 changed files with 1 additions and 23 deletions
  1. +1
    -23
      src/lib/libc/string/strerror_r.c

+ 1
- 23
src/lib/libc/string/strerror_r.c View File

@ -1,10 +1,6 @@
/* $OpenBSD: strerror_r.c,v 1.11 2015/09/06 20:26:20 guenther Exp $ */
/* $OpenBSD: strerror_r.c,v 1.12 2015/10/25 10:22:09 bluhm Exp $ */
/* Public Domain <marc@snafu.org> */ /* Public Domain <marc@snafu.org> */
#ifdef NLS
#include <nl_types.h>
#endif
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <signal.h> #include <signal.h>
@ -66,26 +62,12 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen,
int ret = 0; int ret = 0;
size_t len; size_t len;
#ifdef NLS
nl_catd catd;
catd = catopen("libc", NL_CAT_LOCALE);
#endif
if (0 <= num && num < max) { if (0 <= num && num < max) {
#ifdef NLS
len = strlcpy(buf, catgets(catd, setid, num, list[num]),
buflen);
#else
len = strlcpy(buf, list[num], buflen); len = strlcpy(buf, list[num], buflen);
#endif
if (len >= buflen) if (len >= buflen)
ret = ERANGE; ret = ERANGE;
} else { } else {
#ifdef NLS
len = strlcpy(buf, catgets(catd, setid, 0xffff, def), buflen);
#else
len = strlcpy(buf, def, buflen); len = strlcpy(buf, def, buflen);
#endif
if (len >= buflen) if (len >= buflen)
ret = ERANGE; ret = ERANGE;
else { else {
@ -95,10 +77,6 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen,
} }
} }
#ifdef NLS
catclose(catd);
#endif
return ret; return ret;
} }


Loading…
Cancel
Save