From: nicm Date: Thu, 20 Apr 2017 21:23:16 +0000 (+0000) Subject: control_char() for ASCII needs to include both genuine control X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ec77d776db91339343939c0d78fd190f78524b10;p=openbsd control_char() for ASCII needs to include both genuine control characters and top-bit-set nonprintable characters (so both iscntrl() and !isprint()), fixes behaviour broken in r1.15/r1.16, noticed by deraadt@. ok deraadt tedu --- diff --git a/usr.bin/less/charset.c b/usr.bin/less/charset.c index 73c7a17da9d..4c8db50d553 100644 --- a/usr.bin/less/charset.c +++ b/usr.bin/less/charset.c @@ -164,7 +164,9 @@ int control_char(LWCHAR c) { c &= 0377; - return (iscntrl((unsigned char)c)); + if (utf_mode) + return (iscntrl((unsigned char)c)); + return (iscntrl((unsigned char)c) || !isprint((unsigned char)c)); } /*