diff options
| author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2015-03-05 01:48:34 +0900 |
|---|---|---|
| committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2015-03-05 01:48:34 +0900 |
| commit | 4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5 (patch) | |
| tree | 7bb1c906446262e56ff9992939910f385e53e39b /Src/compat.c | |
| parent | 34641: make it possible to alias tokens (diff) | |
| download | zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.tar zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.tar.gz zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.tar.bz2 zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.tar.lz zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.tar.xz zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.tar.zst zsh-4bc554bb8b46d9b47bb847a72bb5c0226d54b8e5.zip | |
34636: replace broken isprint() on Mac OS X
Diffstat (limited to 'Src/compat.c')
| -rw-r--r-- | Src/compat.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 */ |
