diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2003-05-14 05:16:44 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2003-05-14 05:16:44 +0000 |
commit | 265e5db4ff6a36828aa85e216de9ebd82660b652 (patch) | |
tree | a7b8828600e3197973543a4cf67d7b20b398602d /lib/libc/gen | |
parent | 35c3d7099125fc0a67561be1ba7c7ddbd8d8fce8 (diff) |
sync vis() behaviour when VIS_SAFE to man page: don't do anything if isgraph()
is true, even if the character isn't 7-bit.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/vis.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c index d33c456e109..674564544d4 100644 --- a/lib/libc/gen/vis.c +++ b/lib/libc/gen/vis.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vis.c,v 1.10 2002/07/01 11:28:06 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: vis.c,v 1.11 2003/05/14 05:16:43 pjanzen Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -47,8 +47,9 @@ static char rcsid[] = "$OpenBSD: vis.c,v 1.10 2002/07/01 11:28:06 deraadt Exp $" ((flag & VIS_SP) == 0 && (c) == ' ') || \ ((flag & VIS_TAB) == 0 && (c) == '\t') || \ ((flag & VIS_NL) == 0 && (c) == '\n') || \ - ((flag & VIS_SAFE) && \ - ((c) == '\b' || (c) == '\007' || (c) == '\r'))) + ((flag & VIS_SAFE) && ((c) == '\b' || \ + (c) == '\007' || (c) == '\r' || \ + isgraph((u_char)(c))))) /* * vis - visually encode characters |