NetBSD Problem Report #52710
From www@NetBSD.org Thu Nov 9 17:15:37 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 60F3F7A1EA
for <gnats-bugs@gnats.NetBSD.org>; Thu, 9 Nov 2017 17:15:37 +0000 (UTC)
Message-Id: <20171109171536.801717A237@mollari.NetBSD.org>
Date: Thu, 9 Nov 2017 17:15:36 +0000 (UTC)
From: jamie@dyslexicfish.net
Reply-To: jamie@dyslexicfish.net
To: gnats-bugs@NetBSD.org
Subject: Error in vis(1) manpage
X-Send-Pr-Version: www-1.0
>Number: 52710
>Category: bin
>Synopsis: Error in vis(1) manpage
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Thu Nov 09 17:20:00 +0000 2017
>Last-Modified: Wed Nov 15 11:45:00 +0000 2017
>Originator: Jamie Landeg Jones
>Release: head
>Organization:
>Environment:
n/a (not running netbsd)
>Description:
The -F and -f options are incorrectly specified, as detailed in the attached fix patch to the manual pages source file.
For convenience, the diff from the resultant text is:
30,38c30,37
< -F foldwidth
< Causes vis to fold output lines to foldwidth columns (default
< 80), like fold(1), except that a hidden newline sequence is used,
< (which is removed when inverting the file back to its original
< form with unvis(1)). If the last character in the encoded file
< does not end in a newline, a hidden newline sequence is appended
< to the output. This makes the output usable with various editors
< and other utilities which typically don't work with partial
< lines.
---
> -f Causes vis to fold output lines at N columns (default 80, over‐
> ridden by -F.), like fold(1), except that a hidden newline
> sequence is used, (which is removed when inverting the file back
> to its original form with unvis(1)). If the last character in
> the encoded file does not end in a newline, a hidden newline
> sequence is appended to the output. This makes the output usable
> with various editors and other utilities which typically don't
> work with partial lines.
40c39,40
< -f Same as -F.
---
> -F foldwidth
> Set the column width to foldwidth when using -f.
51,52c51,52
< still doubled and hidden newline sequences inserted if -f or -F
< is selected. When combined with the -f flag, vis becomes like an
---
> still doubled and hidden newline sequences inserted if -f is
> selected. When combined with the -f flag, vis becomes like an
>How-To-Repeat:
man vis
>Fix:
# Patch errors in "vis(1)" manpage:
--- contrib/vis/vis.1.orig 2016-12-02 01:00:16.614591000 +0000
+++ contrib/vis/vis.1 2016-12-23 04:14:50.771339000 +0000
@@ -75,10 +75,12 @@
.Ar extra ,
per
.Xr svis 3 .
-.It Fl F Ar foldwidth
+.It Fl f
Causes
.Nm
-to fold output lines to foldwidth columns (default 80), like
+to fold output lines at N columns (default 80, overridden by
+.Fl F . ) ,
+like
.Xr fold 1 ,
except
that a hidden newline sequence is used, (which is removed
@@ -89,9 +91,11 @@
This makes
the output usable with various editors and other utilities which
typically don't work with partial lines.
-.It Fl f
-Same as
-.Fl F .
+.It Fl F Ar foldwidth
+Set the column width to
+.Ar foldwidth
+when using
+.Fl f .
.It Fl h
Encode using the URI encoding from RFC 1808.
.Pq Dv VIS_HTTPSTYLE
@@ -106,8 +110,6 @@
Turns off any encoding, except for the fact that backslashes are
still doubled and hidden newline sequences inserted if
.Fl f
-or
-.Fl F
is selected.
When combined with the
.Fl f
>Audit-Trail:
From: Thomas Klausner <tk@giga.or.at>
To: gnats-bugs@NetBSD.org
Cc: Christos Zoulas <christos@zoulas.com>
Subject: Re: bin/52710: Error in vis(1) manpage
Date: Mon, 13 Nov 2017 15:28:15 +0100
On Thu, Nov 09, 2017 at 05:20:00PM +0000, jamie@dyslexicfish.net wrote:
> >Number: 52710
> >Category: bin
> >Synopsis: Error in vis(1) manpage
I wonder if this is a bug in vis.c instead.
case 'F':
if ((foldwidth = atoi(optarg)) < 5) {
errx(1, "can't fold lines to less than 5 cols");
/* NOTREACHED */
}
markeol++;
break;
case 'f':
fold++; /* fold output lines to 80 cols */
break; /* using hidden newline */
Perhaps this should be "fold++" instead of "markeol++".
Thomas
From: Jamie Landeg-Jones <jamie@dyslexicfish.net>
To: christos@zoulas.com, tk@giga.or.at, netbsd-bugs@NetBSD.org,
jamie@dyslexicfish.net, gnats-bugs@NetBSD.org, gnats-admin@NetBSD.org
Cc:
Subject: Re: bin/52710: Error in vis(1) manpage
Date: Wed, 15 Nov 2017 11:44:37 +0000
Thomas Klausner <tk@giga.or.at> wrote:
> I wonder if this is a bug in vis.c instead.
>
> case 'F':
> if ((foldwidth = atoi(optarg)) < 5) {
> errx(1, "can't fold lines to less than 5 cols");
> /* NOTREACHED */
> }
> markeol++;
> break;
> case 'f':
> fold++; /* fold output lines to 80 cols */
> break; /* using hidden newline */
>
> Perhaps this should be "fold++" instead of "markeol++".
> Thomas
I see what you're saying: Rather than '-F' simply setting the columns for use by '-f', the
'-F' would basically imply the '-f', and be used instead of it.
Hmm, make sense.. The manpage would still be wrong, but not quite as much!
Cheers, Jamie
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.