From 4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Thu, 5 Mar 2015 01:48:34 +0900 Subject: 34636: replace broken isprint() on Mac OS X --- Src/compat.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Src/compat.c') diff --git a/Src/compat.c b/Src/compat.c index b0bcb6265..09b3d6a5f 100644 --- a/Src/compat.c +++ b/Src/compat.c @@ -951,3 +951,18 @@ int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) /**/ #endif /* BROKEN_WCWIDTH && (__STDC_ISO_10646__ || __APPLE__) */ +/**/ +#if defined(__APPLE__) && defined(BROKEN_ISPRINT) + +/**/ +int +isprint_ascii(int c) +{ + if (!strcmp(nl_langinfo(CODESET), "UTF-8")) + return (c >= 0x20 && c <= 0x7e); + else + return isprint(c); +} + +/**/ +#endif /* __APPLE__ && BROKEN_ISPRINT */ -- cgit v1.2.3