diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-01-23 00:32:13 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-01-23 00:32:13 +0000 |
commit | f1bfe873d3d249f0ad1eefd48481b20ac7d305ed (patch) | |
tree | d87b742cfafed82c961f1a0bd60780e9b6761611 /usr.bin/cut | |
parent | 9a45a0ce6c6d035afb84a39b37702c5d2181580e (diff) |
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@
Diffstat (limited to 'usr.bin/cut')
-rw-r--r-- | usr.bin/cut/cut.1 | 15 | ||||
-rw-r--r-- | usr.bin/cut/cut.c | 8 |
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; |