summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2010-01-23 00:32:12 +0000
committerschwarze <schwarze@openbsd.org>2010-01-23 00:32:12 +0000
commit7696f11410098bf8b6199a68e17fb5d0b1ae638a (patch)
treeea7873e1529abaad4e43fdd3744e9eea3f8cc2b8
parentCorrectly return ENXIO on unhandled ioctls; ok marco@ (diff)
downloadwireguard-openbsd-7696f11410098bf8b6199a68e17fb5d0b1ae638a.tar.xz
wireguard-openbsd-7696f11410098bf8b6199a68e17fb5d0b1ae638a.zip
It's wrong to complain about illegal -c arguments when finding
illegal -b arguments, so fix the error messages; patch from Laurent Ghigonis <ooookiwi at gmail dot com> on tech@. While here, improve the manual, too: * arguments need not be in increasing order * CAVEAT: -b and -c do the same right now feedback and ok jmc@
-rw-r--r--usr.bin/cut/cut.115
-rw-r--r--usr.bin/cut/cut.c8
2 files changed, 16 insertions, 7 deletions
diff --git a/usr.bin/cut/cut.1 b/usr.bin/cut/cut.1
index 282ccf34375..26217c70606 100644
--- a/usr.bin/cut/cut.1
+++ b/usr.bin/cut/cut.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cut.1,v 1.15 2009/02/08 17:15:09 jmc Exp $
+.\" $OpenBSD: cut.1,v 1.16 2010/01/23 00:32:12 schwarze Exp $
.\" $NetBSD: cut.1,v 1.6 1995/10/02 20:19:26 jtc Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
@@ -33,7 +33,7 @@
.\"
.\" @(#)cut.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd $Mdocdate: February 8 2009 $
+.Dd $Mdocdate: January 23 2010 $
.Dt CUT 1
.Os
.Sh NAME
@@ -68,7 +68,7 @@ by a special character.
Column numbering starts from 1.
.Pp
.Ar list
-is a comma or whitespace separated set of increasing numbers and/or
+is a comma or whitespace separated set of numbers and/or
number ranges.
Number ranges consist of a number, a dash
.Pq Sq \- ,
@@ -136,3 +136,12 @@ The
utility is compliant with the
.St -p1003.1-2008
specification.
+.Sh CAVEATS
+The current implementation does not support multi-byte characters.
+Consequently
+.Fl c
+does the same as
+.Fl b ,
+and
+.Fl n
+has no effect.
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index bca1a868697..6bddb6c1fa9 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cut.c,v 1.14 2009/10/27 23:59:37 deraadt Exp $ */
+/* $OpenBSD: cut.c,v 1.15 2010/01/23 00:32:12 schwarze Exp $ */
/* $NetBSD: cut.c,v 1.9 1995/09/02 05:59:23 jtc Exp $ */
/*
@@ -154,11 +154,11 @@ get_list(char *list)
}
}
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 > _POSIX2_LINE_MAX)
- errx(1, "[-cf] list: %d too large (max %d)",
+ errx(1, "[-bcf] list: %d too large (max %d)",
stop, _POSIX2_LINE_MAX);
if (maxval < stop)
maxval = stop;