summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-12-10 13:08:41 -0700
committerKarl Williamson <khw@cpan.org>2014-12-11 11:28:29 -0700
commitba1a4362addff2138f20ec81beb513387b98d277 (patch)
tree65c7e9bf7fc105c7b6ba04532b5e3435956d1e37 /locale.c
parent62fe37a7bf046974cc0d734bd54112719cfbdd32 (diff)
downloadperl-ba1a4362addff2138f20ec81beb513387b98d277.tar.gz
Stop errorneous warnings for C locale
HP-UX - B.11.00/64 has a problem with the C locale that's only noticeable from newly added warnings flooding the logs. This adds a test to suppress them.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/locale.c b/locale.c
index a5a2cb3a83..429fdb7b1f 100644
--- a/locale.c
+++ b/locale.c
@@ -345,7 +345,16 @@ Perl_new_ctype(pTHX_ const char *newctype)
/* We only handle single-byte locales (outside of UTF-8 ones; so if
* this locale requires than one byte, there are going to be
* problems. */
- if (check_for_problems && MB_CUR_MAX > 1) {
+ if (check_for_problems && MB_CUR_MAX > 1
+
+ /* Some platforms return MB_CUR_MAX > 1 for even the "C"
+ * locale. Just assume that the implementation for them (plus
+ * for POSIX) is correct and the > 1 value is spurious. (Since
+ * these are specially handled to never be considered UTF-8
+ * locales, as long as this is the only problem, everything
+ * should work fine */
+ && strNE(newctype, "C") && strNE(newctype, "POSIX"))
+ {
multi_byte_locale = TRUE;
}
#endif