summaryrefslogtreecommitdiff
path: root/lib/libc/citrus
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2013-05-03 13:53:50 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2013-05-03 13:53:50 +0000
commit3b49bded25a0e6390afd1120c38c5070ad0cf9a3 (patch)
treef6f52446140d7a851669366a6a201b4cd748c06d /lib/libc/citrus
parentb5efafc5276b3b5281f3589d829ab6d58ea84838 (diff)
Fix resetting MB_CUR_MAX when switching locales away from a UTF-8 locale.
Patch by Vladimir Támara Patiño <vtamara@pasosdeJesus.org> ok mpi millert
Diffstat (limited to 'lib/libc/citrus')
-rw-r--r--lib/libc/citrus/citrus_ctype.c6
-rw-r--r--lib/libc/citrus/citrus_ctype_local.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/citrus/citrus_ctype.c b/lib/libc/citrus/citrus_ctype.c
index 129e10b37f2..cb187c5e9a1 100644
--- a/lib/libc/citrus/citrus_ctype.c
+++ b/lib/libc/citrus/citrus_ctype.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: citrus_ctype.c,v 1.3 2012/12/05 23:19:59 deraadt Exp $ */
+/* $OpenBSD: citrus_ctype.c,v 1.4 2013/05/03 13:53:49 stsp Exp $ */
/* $NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $ */
/*-
@@ -38,10 +38,12 @@
struct _citrus_ctype_rec _citrus_ctype_none = {
&_citrus_none_ctype_ops, /* cc_ops */
+ 1 /* cc_mb_cur_max */
};
struct _citrus_ctype_rec _citrus_ctype_utf8 = {
&_citrus_utf8_ctype_ops, /* cc_ops */
+ _CITRUS_UTF8_MB_CUR_MAX /* cc_mb_cur_max */
};
int
@@ -49,11 +51,9 @@ _citrus_ctype_open(struct _citrus_ctype_rec **rcc, char const *encname)
{
if (!strcmp(encname, "NONE")) {
*rcc = &_citrus_ctype_none;
- __mb_cur_max = 1;
return (0);
} else if (!strcmp(encname, "UTF8")) {
*rcc = &_citrus_ctype_utf8;
- __mb_cur_max = _CITRUS_UTF8_MB_CUR_MAX;
return (0);
}
diff --git a/lib/libc/citrus/citrus_ctype_local.h b/lib/libc/citrus/citrus_ctype_local.h
index 4536261df12..7753ac1513a 100644
--- a/lib/libc/citrus/citrus_ctype_local.h
+++ b/lib/libc/citrus/citrus_ctype_local.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: citrus_ctype_local.h,v 1.3 2012/06/06 16:58:02 matthew Exp $ */
+/* $OpenBSD: citrus_ctype_local.h,v 1.4 2013/05/03 13:53:49 stsp Exp $ */
/* $NetBSD: citrus_ctype_local.h,v 1.2 2003/03/05 20:18:15 tshiozak Exp $ */
/*-
@@ -81,6 +81,7 @@ struct _citrus_ctype_ops_rec {
struct _citrus_ctype_rec {
struct _citrus_ctype_ops_rec *cc_ops;
+ size_t cc_mb_cur_max;
};
#endif