NetBSD Problem Report #44747

From www@NetBSD.org  Mon Mar 21 00:38:42 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 47D1963B9E3
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 21 Mar 2011 00:38:42 +0000 (UTC)
Message-Id: <20110321003841.0B08B63B873@www.NetBSD.org>
Date: Mon, 21 Mar 2011 00:38:41 +0000 (UTC)
From: bughunting@xs4all.nl
Reply-To: bughunting@xs4all.nl
To: gnats-bugs@NetBSD.org
Subject: Minor errors in cut(1)'s manpage and usage lines
X-Send-Pr-Version: www-1.0

>Number:         44747
>Category:       bin
>Synopsis:       Minor errors in cut(1)'s manpage and usage lines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 21 00:40:00 +0000 2011
>Closed-Date:    Sat Jun 09 19:23:44 +0000 2012
>Last-Modified:  Sat Jun 09 19:25:07 +0000 2012
>Originator:     Bug Hunting
>Release:        NetBSD 5.99.48
>Organization:
>Environment:
>Description:
Some minor errors exist in cut(1)'s manpage and usage lines.
>How-To-Repeat:
"man -s 1 cut"; note that the mentioning of columns and fields isn't equal in the
whole of the text (it would increase readability if it did), and that the latter is even
missing at one place.

Also issue the following:

$ cut     # shows `Usage' line with an occurence of `file1'
usage:  cut -b list [-n] [file ...]
        cut -c list [file1 ...]
        cut -f list [-d delim] [-s] [file ...]
$ cut -ba # shows `-b' option missing
cut: [-cf] list: illegal list value
$ cut -b0 # shows `-b' option missing
cut: [-cf] list: values may not include zero
>Fix:
Apply the following patch:

$ cd /usr/src/usr.bin/cut/; cvs diff -u
cvs diff: Diffing .
Index: cut.1
===================================================================
RCS file: /cvsroot/src/usr.bin/cut/cut.1,v
retrieving revision 1.16
diff -u -r1.16 cut.1
--- cut.1	29 Mar 2009 05:58:41 -0000	1.16
+++ cut.1	21 Mar 2011 00:33:50 -0000
@@ -32,7 +32,7 @@
 .\"
 .\"     @(#)cut.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd December 21, 2008
+.Dd March 21, 2011
 .Dt CUT 1
 .Os
 .Sh NAME
@@ -71,7 +71,7 @@
 .Ar list
 can be in terms of column position or in terms of fields delimited
 by a special character.
-Column numbering starts from 1.
+Column and field numbering start from 1.
 .Pp
 .Ar list
 is a comma or whitespace separated set of increasing numbers and/or
@@ -79,14 +79,14 @@
 Number ranges consist of a number, a dash
 .Pq Li \- ,
 and a second number
-and select the fields or columns from the first number to the second,
+and select the columns or fields from the first number to the second,
 inclusive.
 Numbers or number ranges may be preceded by a dash, which selects all
-fields or columns from 1 to the first number.
+columns or fields from 1 to the first number.
 Numbers or number ranges may be followed by a dash, which selects all
-fields or columns from the last number to the end of the line.
+columns or fields from the last number to the end of the line.
 Numbers and number ranges may be repeated, overlapping, and in any order.
-It is not an error to select fields or columns not present in the
+It is not an error to select columns or fields not present in the
 input line.
 .Pp
 The options are as follows:
Index: cut.c
===================================================================
RCS file: /cvsroot/src/usr.bin/cut/cut.c,v
retrieving revision 1.25
diff -u -r1.25 cut.c
--- cut.c	21 Jul 2008 14:19:22 -0000	1.25
+++ cut.c	21 Mar 2011 00:33:50 -0000
@@ -166,7 +166,7 @@
 	 * This parser is less restrictive than the Draft 9 POSIX spec.
 	 * POSIX doesn't allow lists that aren't in increasing order or
 	 * overlapping lists.  We also handle "-3-5" although there's no
-	 * real reason too.
+	 * real reason to.
 	 */
 	for (; (p = strtok(list, ", \t")) != NULL; list = NULL) {
 		setautostart = start = stop = 0;
@@ -189,9 +189,9 @@
 			}
 		}
 		if (*p)
-			errx(1, "[-cf] list: illegal list value");
+			errx(1, "[-bcf] list: illegal list value");
 		if (!stop || !start)
-			errx(1, "[-cf] list: values may not include zero");
+			errx(1, "[-bcf] list: values may not include zero");
 		if (stop + 1 > numpositions) {
 			size_t newsize;
 			newsize = roundup(stop + 1, ALLOC_CHUNK);
@@ -286,7 +286,7 @@
 usage(void)
 {
 	(void)fprintf(stderr, "Usage:\tcut -b list [-n] [file ...]\n"
-	    "\tcut -c list [file1 ...]\n"
+	    "\tcut -c list [file ...]\n"
 	    "\tcut -f list [-d delim] [-s] [file ...]\n");
 	exit(1);
 }

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sat, 09 Jun 2012 19:23:44 +0000
State-Changed-Why:
Committed, thanks.
(as Bug mentioned, the last chunk was obsolete by now)


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44747 CVS commit: src/usr.bin/cut
Date: Sat, 9 Jun 2012 19:22:47 +0000

 Module Name:	src
 Committed By:	wiz
 Date:		Sat Jun  9 19:22:47 UTC 2012

 Modified Files:
 	src/usr.bin/cut: cut.c

 Log Message:
 Add -b to short error messages. Fix typo. From Bug Hunting in PR 44747.


 To generate a diff of this commit:
 cvs rdiff -u -r1.26 -r1.27 src/usr.bin/cut/cut.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44747 CVS commit: src/usr.bin/cut
Date: Sat, 9 Jun 2012 19:23:14 +0000

 Module Name:	src
 Committed By:	wiz
 Date:		Sat Jun  9 19:23:14 UTC 2012

 Modified Files:
 	src/usr.bin/cut: cut.1

 Log Message:
 Consistenly mention columns and fields. From Bug Hunting in PR 44747.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16 -r1.17 src/usr.bin/cut/cut.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.