Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen Add VIS_GLOB (Brooks Davies)
details: https://anonhg.NetBSD.org/src/rev/b8206f681978
branches: trunk
changeset: 783311:b8206f681978
user: christos <christos%NetBSD.org@localhost>
date: Fri Dec 14 21:38:18 2012 +0000
description:
Add VIS_GLOB (Brooks Davies)
diffstat:
lib/libc/gen/vis.3 | 14 ++++++++++++--
lib/libc/gen/vis.c | 12 +++++++++---
2 files changed, 21 insertions(+), 5 deletions(-)
diffs (82 lines):
diff -r 240d340821fe -r b8206f681978 lib/libc/gen/vis.3
--- a/lib/libc/gen/vis.3 Fri Dec 14 21:36:59 2012 +0000
+++ b/lib/libc/gen/vis.3 Fri Dec 14 21:38:18 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: vis.3,v 1.27 2011/05/17 07:10:39 joerg Exp $
+.\" $NetBSD: vis.3,v 1.28 2012/12/14 21:38:18 christos Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)vis.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd March 12, 2011
+.Dd December 14, 2012
.Dt VIS 3
.Os
.Sh NAME
@@ -219,6 +219,15 @@
The following flags
alter this:
.Bl -tag -width VIS_WHITEX
++.It Dv VIS_GLOB
+Also encode magic characters
+.Ql ( * ,
+.Ql \&? ,
+.Ql \&[
+and
+.Ql # )
+recognized by
+.Xr glob 3 .
.It Dv VIS_SP
Also encode space.
.It Dv VIS_TAB
@@ -408,6 +417,7 @@
.Sh SEE ALSO
.Xr unvis 1 ,
.Xr vis 1 ,
+.Xr glob 3 ,
.Xr unvis 3
.Rs
.%A T. Berners-Lee
diff -r 240d340821fe -r b8206f681978 lib/libc/gen/vis.c
--- a/lib/libc/gen/vis.c Fri Dec 14 21:36:59 2012 +0000
+++ b/lib/libc/gen/vis.c Fri Dec 14 21:38:18 2012 +0000
@@ -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 @@
#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 @@
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'; \
Home |
Main Index |
Thread Index |
Old Index