Commit Graph

62 Commits

Author SHA1 Message Date
Enji Cooper
48e0fbc3f9 Integrate usr.bin/cut/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2014-10-09 01:46:31 +00:00
Andrew Turner
bd9dd0c6c9 The is_delim function works on wchar_t characters not ints, update the
function to take a wchar_t as it's argument.

This fixes the build when wchar_t is not an int, i.e. ARM EABI.
2012-11-24 04:15:25 +00:00
Eitan Adler
18ba28c82c Add 'w' flag to:
Use whitespace (spaces and tabs) as the delimiter.
Consecutive spaces and tabs count as one single field
separator.

Reviewed by:	swildner@dragonflybsd.org
Approved by:	cperciva
Obtained from:	DragonFlyBSD
MFC after:	1 week
2012-11-20 01:57:21 +00:00
Kevin Lo
0087e1818e Fix typo 2012-06-11 03:10:15 +00:00
Kevin Lo
d334b28625 - Consistenly mention columns and fields
- Add -b to short error messages

Obtained from:	NetBSD
2012-06-11 03:02:40 +00:00
Ed Schouten
41b662c583 Add missing static keywords to cut(1) 2011-11-06 08:14:51 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Tom Rhodes
6abf213ba4 Fix punctuation.
PR:		132834
Submitted by:	"Alan R. S. Bueno" <alan.bsd@gmail.com>
2009-04-01 08:33:54 +00:00
Ruslan Ermilov
081fa92f3b - Adopt the short description from POSIX as it better matches the
utility name.

- Fix a bug in description: the range preceded by a dash selects
  up to the last number, not first.
2007-02-28 10:13:32 +00:00
Ruslan Ermilov
6c7216df78 Sort sections. 2005-01-18 13:43:56 +00:00
Ruslan Ermilov
a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Tim J. Robbins
a2222839a5 When the last line of a file is missing a newline in -f mode, pass a
length argument to mbrtowc() that accounts for the terminating newline
character we add automatically. Failing to do this caused the loop to
unexpectedly run out of characters and incorrectly signal an "Illegal byte
sequence" error.
2004-11-05 10:45:23 +00:00
Ruslan Ermilov
2410103c1d mdoc(7) fixes. 2004-07-07 19:57:16 +00:00
Tim J. Robbins
ea8348d4e4 Describe the algorithm used by the -n option. 2004-06-28 06:20:28 +00:00
Tim J. Robbins
3b90bf797f Move some variable declarations to the top of the file. 2004-06-28 06:05:36 +00:00
Tim J. Robbins
f0b4606f3f Silence a warning about an unused argument. 2004-06-27 16:58:56 +00:00
Tim J. Robbins
8180b4573c Correct the description of the -f option: input and output fields are
separated by the field delimiter character, which is not necessarily
the tab character.
2004-06-27 16:55:25 +00:00
Tim J. Robbins
a5c4bafcd1 Handle multibyte characters when cutting out fields (-f and -d options.) 2004-06-27 16:42:33 +00:00
Tim J. Robbins
0dcb7b75a3 Update a comment that compared the parser with an obsolete draft of
IEEE Std 1003.2-1992. Most of the "extensions" here were actually
required by the final version of the standard.
2004-06-27 15:27:15 +00:00
Tim J. Robbins
f91650cf2d Add cross-reference to colrm(1). 2004-06-27 14:57:42 +00:00
Tim J. Robbins
364d0a915c Implement the -c option correctly in locales with multibyte characters
instead of treating it as a synonym for -b.
2004-06-27 14:55:07 +00:00
Tim J. Robbins
d900c38411 Make the handling of invalid multibyte sequences more robust by using
mbrlen() instead of mblen().
2004-06-27 10:35:28 +00:00
Giorgos Keramidas
b9e09bb643 Duplicate "from".
PR:		docs/51724
Submitted by:	Christopher Nehren <apeiron@comcast.net
2003-05-03 15:55:23 +00:00
Ruslan Ermilov
792c362f9c mdoc(7) police: markup polishing.
Approved by:	re
2002-11-26 10:51:47 +00:00
David Malone
f4ac32def2 ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by:	md5
2002-09-04 23:29:10 +00:00
Juli Mallett
3a7fc8ce59 Remove local prototypes for main(). 2002-08-19 03:07:56 +00:00
Tom Rhodes
a38d3fb35e Revert previous delta for cut(1) and calendar(1) as they were not applied
correctly.  My fault, forgot that -current was checked out.
2002-07-23 15:09:56 +00:00
Tom Rhodes
623bc624b0 MFC: Fix some grammar, greater reduce diffs to HEAD 2002-07-22 21:14:16 +00:00
David E. O'Brien
77c8bf7cae Consistently use FBSDID 2002-06-30 05:34:21 +00:00
Tim J. Robbins
84fb5a42d2 cut(1) appeared at least as early as System III. 2002-06-11 08:11:12 +00:00
Tim J. Robbins
500b4b738d Add an examples section. Avoid beginning a sentence with a lowercase letter. 2002-06-08 08:37:27 +00:00
Tim J. Robbins
e4d15ec387 Document cut(1)'s deficiencies in dealing with multibyte characters in the
BUGS section. These will be easy to fix when we have wide character stdio.
2002-06-08 08:08:47 +00:00
Tim J. Robbins
393cf5088e Don't split multibyte characters when the -n option is specified. 2002-06-08 07:27:21 +00:00
Tim J. Robbins
93738f50e5 style(9): don't initialise variables in their declaration, remove space
after function name, use __unused on unused parameters instead of
initialising them to bogus values.
2002-06-07 09:13:43 +00:00
Tim J. Robbins
80a4c82db1 Move exit status info into Diagnostics section. 2002-05-30 00:46:00 +00:00
Ruslan Ermilov
a59a315d08 mdoc(7) police: use .Fl to represent stdin. 2002-05-29 18:21:42 +00:00
Tim J. Robbins
f457179a13 Initialise the `positions' array correctly before use. 2002-05-27 02:01:25 +00:00
Tim J. Robbins
204c78a163 When a file name of "-" is given, read from standard input (SUSv3) 2002-05-24 09:56:18 +00:00
Tim J. Robbins
a8522a9bb7 Allow byte/character positions >_POSIX2_LINE_MAX to be specified by
dynamically growing the `positions' array.
2002-05-24 09:11:18 +00:00
Tim J. Robbins
a6ea32c3c5 If processing of one file fails, try to process the remaining files and
exit non-zero instead of immediately exiting. The traditional BSD
behaviour is explicitly forbidden by P1003.2.
2002-05-24 06:03:12 +00:00
Mark Murray
91bd71d206 Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
Mark Murray
d0effe7563 WARNS=2 and -Wall are not both needed. (The second is a subset of the
first)
2001-12-03 00:16:52 +00:00
Dima Dorfman
f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Dima Dorfman
41ff7633ea Silence the remaining warnings and clamp down with WARNS=2.
Not objected to by:	-audit
2001-06-07 02:57:58 +00:00
Dima Dorfman
1928e20e95 Teach cut(1) how to handle long lines: convert from fgets(3) to fgetln(3).
PR:		26810
Reviewed by:	dwmalone
2001-04-25 05:42:53 +00:00
Philippe Charnier
39e21a1b64 Remove duplicate FreeBSD Id
Remoce unused #include
Use imperative mode to start flag description
2001-02-06 20:03:48 +00:00
Will Andrews
99557a7988 De-__P()-ify
Reviewed by:	markm
2001-01-28 00:35:40 +00:00
Will Andrews
d8a3fbd50d BDECFLAGS: constify; use proper types. Add $FreeBSD$, clean up #ifndef lint.
Reviewed by:	markm
2001-01-28 00:34:29 +00:00
Ruslan Ermilov
8fe908ef0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
Sheldon Hearn
87faa07bec Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 12:20:22 +00:00