summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstsp <>2013-06-01 21:26:18 +0000
committerstsp <>2013-06-01 21:26:18 +0000
commitef3e9ec826e80cf739a5af423ff5356007a9414b (patch)
tree8701040bc25e6f072ef344f19aded43a724d40a2 /src
parentd09ea904ae8fc2ec4057e71047ca2469c9557d1d (diff)
downloadopenbsd-ef3e9ec826e80cf739a5af423ff5356007a9414b.tar.gz
openbsd-ef3e9ec826e80cf739a5af423ff5356007a9414b.tar.bz2
openbsd-ef3e9ec826e80cf739a5af423ff5356007a9414b.zip
Fix catopen(3) for UTF-8 locales and update the implementation to POSIX-2008.
Catalogs had an arbitrary character set which was used regardless of locale. Add UTF-8-encoded catalogs for libc error messages, and rename existing ones to indicate their character sets. catopen(3) now chooses a catalog which matches the locale's encoding, if available. help & ok matthew, man page bits ok jmc, input from naddy and bluhm
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/string/strerror_r.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/string/strerror_r.c b/src/lib/libc/string/strerror_r.c
index aa63408ab8..b85136055b 100644
--- a/src/lib/libc/string/strerror_r.c
+++ b/src/lib/libc/string/strerror_r.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strerror_r.c,v 1.7 2007/03/01 16:29:09 bluhm Exp $ */ 1/* $OpenBSD: strerror_r.c,v 1.8 2013/06/01 21:26:18 stsp Exp $ */
2/* Public Domain <marc@snafu.org> */ 2/* Public Domain <marc@snafu.org> */
3 3
4#ifdef NLS 4#ifdef NLS
@@ -75,7 +75,7 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen,
75 75
76#ifdef NLS 76#ifdef NLS
77 nl_catd catd; 77 nl_catd catd;
78 catd = catopen("libc", 0); 78 catd = catopen("libc", NL_CAT_LOCALE);
79#endif 79#endif
80 80
81 if (0 <= num && num < max) { 81 if (0 <= num && num < max) {