>From 6b7434fb222144af3ae9e2d4fd6b4c72eec25f5b Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen Date: Sat, 21 Jul 2018 13:19:23 -0700 Subject: [PATCH] df: avoid multibyte character corruption on macOS * src/df.c (hide_problematic_chars): Use c_iscntrl() as passing 8 bit characters to iscntrl() is not supported on macOS. * NEWS: Mention the bug fix. Fixes https://bugs.gnu.org/32236 --- NEWS | 4 ++++ src/df.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index af1a990..aa3b4f9 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ GNU coreutils NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + df no longer corrupts displayed multibyte characters on macOS. + * Noteworthy changes in release 8.30 (2018-07-01) [stable] diff --git a/src/df.c b/src/df.c index 1178865..c851fcc 100644 --- a/src/df.c +++ b/src/df.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "system.h" #include "canonicalize.h" @@ -281,7 +282,7 @@ hide_problematic_chars (char *cell) char *p = cell; while (*p) { - if (iscntrl (to_uchar (*p))) + if (c_iscntrl (to_uchar (*p))) *p = '?'; p++; } -- 2.9.3