Add VIS_DQ (for OpenBSD compat)

This commit is contained in:
christos 2017-04-23 01:58:48 +00:00
parent f81dba2062
commit 6f84e2e257
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: vis.3,v 1.45 2016/06/08 15:00:04 wiz Exp $
.\" $NetBSD: vis.3,v 1.46 2017/04/23 01:58:48 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 January 14, 2015
.Dd April 22, 2017
.Dt VIS 3
.Os
.Sh NAME
@ -242,6 +242,8 @@ except space, tab, and newline are encoded (see
The following flags
alter this:
.Bl -tag -width VIS_WHITEX
.It Dv VIS_DW
Also encode double quotes
.It Dv VIS_GLOB
Also encode the magic characters
.Ql ( * ,

View File

@ -1,4 +1,4 @@
/* $NetBSD: vis.c,v 1.72 2017/02/12 22:37:49 christos Exp $ */
/* $NetBSD: vis.c,v 1.73 2017/04/23 01:58:48 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.72 2017/02/12 22:37:49 christos Exp $");
__RCSID("$NetBSD: vis.c,v 1.73 2017/04/23 01:58:48 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#ifdef __FBSDID
__FBSDID("$FreeBSD$");
@ -377,6 +377,7 @@ makeextralist(int flags, const char *src)
if (flags & VIS_SP) *d++ = L' ';
if (flags & VIS_TAB) *d++ = L'\t';
if (flags & VIS_NL) *d++ = L'\n';
if (flags & VIS_DQ) *d++ = L'"';
if ((flags & VIS_NOSLASH) == 0) *d++ = L'\\';
*d = L'\0';