diff options
author | bluhm <> | 2015-10-25 10:22:09 +0000 |
---|---|---|
committer | bluhm <> | 2015-10-25 10:22:09 +0000 |
commit | 095da41d5c40b18f47f3a1a5d002f58a5d4848de (patch) | |
tree | 6adc76ba8238f771a454d24e1122141208769de2 | |
parent | 0212631215a7430ecb20d586035f725f42d0cde4 (diff) | |
download | openbsd-095da41d5c40b18f47f3a1a5d002f58a5d4848de.tar.gz openbsd-095da41d5c40b18f47f3a1a5d002f58a5d4848de.tar.bz2 openbsd-095da41d5c40b18f47f3a1a5d002f58a5d4848de.zip |
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@
-rw-r--r-- | src/lib/libc/string/strerror_r.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/lib/libc/string/strerror_r.c b/src/lib/libc/string/strerror_r.c index 8a15ff1afc..53f5d6bda4 100644 --- a/src/lib/libc/string/strerror_r.c +++ b/src/lib/libc/string/strerror_r.c | |||
@@ -1,10 +1,6 @@ | |||
1 | /* $OpenBSD: strerror_r.c,v 1.11 2015/09/06 20:26:20 guenther Exp $ */ | 1 | /* $OpenBSD: strerror_r.c,v 1.12 2015/10/25 10:22:09 bluhm Exp $ */ |
2 | /* Public Domain <marc@snafu.org> */ | 2 | /* Public Domain <marc@snafu.org> */ |
3 | 3 | ||
4 | #ifdef NLS | ||
5 | #include <nl_types.h> | ||
6 | #endif | ||
7 | |||
8 | #include <errno.h> | 4 | #include <errno.h> |
9 | #include <limits.h> | 5 | #include <limits.h> |
10 | #include <signal.h> | 6 | #include <signal.h> |
@@ -66,26 +62,12 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen, | |||
66 | int ret = 0; | 62 | int ret = 0; |
67 | size_t len; | 63 | size_t len; |
68 | 64 | ||
69 | #ifdef NLS | ||
70 | nl_catd catd; | ||
71 | catd = catopen("libc", NL_CAT_LOCALE); | ||
72 | #endif | ||
73 | |||
74 | if (0 <= num && num < max) { | 65 | if (0 <= num && num < max) { |
75 | #ifdef NLS | ||
76 | len = strlcpy(buf, catgets(catd, setid, num, list[num]), | ||
77 | buflen); | ||
78 | #else | ||
79 | len = strlcpy(buf, list[num], buflen); | 66 | len = strlcpy(buf, list[num], buflen); |
80 | #endif | ||
81 | if (len >= buflen) | 67 | if (len >= buflen) |
82 | ret = ERANGE; | 68 | ret = ERANGE; |
83 | } else { | 69 | } else { |
84 | #ifdef NLS | ||
85 | len = strlcpy(buf, catgets(catd, setid, 0xffff, def), buflen); | ||
86 | #else | ||
87 | len = strlcpy(buf, def, buflen); | 70 | len = strlcpy(buf, def, buflen); |
88 | #endif | ||
89 | if (len >= buflen) | 71 | if (len >= buflen) |
90 | ret = ERANGE; | 72 | ret = ERANGE; |
91 | else { | 73 | else { |
@@ -95,10 +77,6 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen, | |||
95 | } | 77 | } |
96 | } | 78 | } |
97 | 79 | ||
98 | #ifdef NLS | ||
99 | catclose(catd); | ||
100 | #endif | ||
101 | |||
102 | return ret; | 80 | return ret; |
103 | } | 81 | } |
104 | 82 | ||