summaryrefslogtreecommitdiff
path: root/Src/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/compat.c')
-rw-r--r--Src/compat.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/Src/compat.c b/Src/compat.c
index b0bcb6265..b3a8b063c 100644
--- a/Src/compat.c
+++ b/Src/compat.c
@@ -443,7 +443,7 @@ zgetcwd(void)
ret = getcwd(cwdbuf, PATH_MAX);
if (ret)
ret = dupstring(ret);
- free(cwdbuf);
+ zfree(cwdbuf, PATH_MAX);
#endif /* GETCWD_CALLS_MALLOC */
}
#endif /* HAVE_GETCWD */
@@ -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 */