artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57f7e8a
)
control_char() for ASCII needs to include both genuine control
author
nicm
<nicm@openbsd.org>
Thu, 20 Apr 2017 21:23:16 +0000
(21:23 +0000)
committer
nicm
<nicm@openbsd.org>
Thu, 20 Apr 2017 21:23:16 +0000
(21:23 +0000)
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
usr.bin/less/charset.c
patch
|
blob
|
history
diff --git
a/usr.bin/less/charset.c
b/usr.bin/less/charset.c
index
73c7a17
..
4c8db50
100644
(file)
--- 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));
}
/*