From: Chih-Hsuan Yen Date: Sat, 21 Jul 2018 20:19:23 +0000 (-0700) Subject: df: avoid multibyte character corruption on macOS X-Git-Tag: v8.31~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=437555061ca94fb009cdf0e96b3368f00de95f1e;p=thirdparty%2Fcoreutils.git 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 --- diff --git a/NEWS b/NEWS index af1a9903de..aa3b4f9947 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 11788654b9..c851fcc682 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++; }