summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-09-01 17:15:50 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-09-01 17:15:50 +0000
commit788aafce216e68e4fa682f8f45fd8db08fa5c31d (patch)
treea535d083b343b276316c9ce23683b6479b930da8 /lib
parent3c763c8fec1b595709ce085ba52110a4b4fe77c0 (diff)
repair VIS_GLOB; deraadt@ otto@ OK
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/vis.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c
index b3909fc4970..8e44ad733c7 100644
--- a/lib/libc/gen/vis.c
+++ b/lib/libc/gen/vis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vis.c,v 1.18 2005/08/29 18:38:41 otto Exp $ */
+/* $OpenBSD: vis.c,v 1.19 2005/09/01 17:15:49 millert Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -104,7 +104,8 @@ vis(char *dst, int c, int flag, int nextc)
goto done;
}
}
- if (((c & 0177) == ' ') || (flag & VIS_OCTAL)) {
+ if (((c & 0177) == ' ') || (flag & VIS_OCTAL) ||
+ ((flag & VIS_GLOB) && (c == '*' || c == '?' || c == '[' || c == '#'))) {
*dst++ = '\\';
*dst++ = ((u_char)c >> 6 & 07) + '0';
*dst++ = ((u_char)c >> 3 & 07) + '0';