summaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2012-12-14 22:45:03 +0000
committerBrooks Davis <brooks@FreeBSD.org>2012-12-14 22:45:03 +0000
commit2efa758bee95f1e8733ead68c8d1dff618929894 (patch)
tree79ff76cf7a28b87ab68e35585f6720a3e936e33d /vis.c
parent5f6a0f033f2c9871dcb86ce93de2b8e90d682b8e (diff)
Vendor import of NetBSD's (un)vis(3) at 2012-12-14vendor/NetBSD/libc-vis/20121214
Notes
svn path=/vendor/NetBSD/libc-vis/dist/; revision=244230 svn path=/vendor/NetBSD/libc-vis/20121412/; revision=244231; tag=vendor/NetBSD/libc-vis/20121214
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/vis.c b/vis.c
index d20694410942..0afc6eaa613c 100644
--- a/vis.c
+++ b/vis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.c,v 1.44 2011/03/12 19:52:48 christos Exp $ */
+/* $NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -57,7 +57,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.44 2011/03/12 19:52:48 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -89,7 +89,7 @@ static char *do_svis(char *, size_t *, int, int, int, const char *);
#define xtoa(c) "0123456789abcdef"[c]
#define XTOA(c) "0123456789ABCDEF"[c]
-#define MAXEXTRAS 5
+#define MAXEXTRAS 9
#define MAKEEXTRALIST(flag, extra, orig_str) \
do { \
@@ -103,6 +103,12 @@ do { \
for (o = orig, e = extra; (*e++ = *o++) != '\0';) \
continue; \
e--; \
+ if (flag & VIS_GLOB) { \
+ *e++ = '*'; \
+ *e++ = '?'; \
+ *e++ = '['; \
+ *e++ = '#'; \
+ } \
if (flag & VIS_SP) *e++ = ' '; \
if (flag & VIS_TAB) *e++ = '\t'; \
if (flag & VIS_NL) *e++ = '\n'; \