| History log of /src/usr.bin/cut/cut.c |
| Revision | | Date | Author | Comments |
| 1.32 |
| 09-Mar-2025 |
gutteridge | cut.c: simplify a comment
From a commit by Tim J. Robbins to FreeBSD back in 2004: "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."
|
| 1.31 |
| 04-Mar-2025 |
gutteridge | cut(1): implement the -n option (for use with -b)
This command had long advertised the existence of -n (in its usage message and man page) but had never implemented it. Here we borrow the implementation written by Tim J. Robbins for FreeBSD, which provides most code changes and almost all documentation changes applied here. We also borrow some options handling simplifications from OpenBSD, with some minor tweaks to code and documentation by me.
Addresses PR bin/59029. This is a pretty obscure feature, it seems, so it's unlikely it will be pulled up to stable branches.
|
| 1.30 |
| 19-Feb-2025 |
gutteridge | cut(1): correct some comments
|
| 1.29 |
| 03-Feb-2014 |
wiz | From Igor Sobrado in private email (based on his OpenBSD commit):
improve POSIX compliance by continuing to process the remaining file operands after not finding an input file.
from the IEEE Std 1003.1-2008 (``POSIX.1'') rationale:
"Unlike other utilities, some historical implementations of cut exit after not finding an input file, rather than continuing to process the remaining file operands. This behavior is prohibited by this volume of POSIX.1-2008, where only the exit status is affected by this problem."
joint work with jmc@, who identified the compliance issue, and millert@
ok millert@, jmc@
|
| 1.28 |
| 20-Jun-2012 |
wiz | branches: 1.28.2; - remove trailing white space; - synchronize argument name to `-d' in `usage' line with man page.
From Bug Hunting.
|
| 1.27 |
| 09-Jun-2012 |
wiz | Add -b to short error messages. Fix typo. From Bug Hunting in PR 44747.
|
| 1.26 |
| 06-Apr-2012 |
wiz | Sync usage with man page, from Bug Hunting.
|
| 1.25 |
| 21-Jul-2008 |
lukem | branches: 1.25.2; Remove the \n and tabs from the __COPYRIGHT() strings. Tweak to use a consistent format.
|
| 1.24 |
| 15-Dec-2007 |
perry | branches: 1.24.6; convert __attribute__s to applicable cdefs.h macros
|
| 1.23 |
| 02-Jul-2007 |
christos | branches: 1.23.4; PR/36583: Aleksey Cheusov: /usr/bin/cut: -[bcf] positions are limited to 2048 Fix provided by Anon Ymous.
|
| 1.22 |
| 17-Feb-2007 |
hubertf | Teach 'cut -c' about multibyte characters. Fixes PR 34244, using the patch from the PR and some hacking by myself to avoid code redundancy.
Passes the regression tests I've added.
(How many weeks of purgatory do I get for the cpp(1) hack to avoid code redundancy? I guess I can always say it was inspired by some old version of our md5 sources...)
|
| 1.21 |
| 29-Jul-2006 |
jnemeth | PR/33995: Aleksey Cheusov: support use "-" to indicate stdin from SUS
|
| 1.20 |
| 25-Apr-2006 |
christos | Coverity CID 2790: Always free tmp buffer, not somethimes.
|
| 1.19 |
| 30-Mar-2006 |
dsl | If fgetln() returns a buffer that isn't terminated by \n, free the temporary buffer inside the loop. Fixes coverty CID:1674. (This should only happen at EOF, so the loop SHOULD terminate.) While here always output a newline at the end of the input data even when the last (unterminated) line doesn't contain a separator.
|
| 1.18 |
| 22-Mar-2005 |
yamt | a fix from openbsd. XXX is it better to output a newline?
> revision 1.7 > date: 2000/06/04 23:52:19; author: aaron; state: Exp; lines: +30 -14 > Handle the case where the last line of input does not contain a newline; issue > reported by marc@snafu.org. The main thing here is we use fgetln() instead of > fgets(), also giving us the advantage of being able to handle lines of > unlimited length. Some -Wall and other fixes from millert@ as well.
|
| 1.17 |
| 17-Feb-2005 |
xtraeme | branches: 1.17.2; Kill __P(), use ANSI function declarations, constify; WARNS=3.
|
| 1.16 |
| 07-Aug-2003 |
agc | branches: 1.16.4; Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
|
| 1.15 |
| 11-Jun-2002 |
itojun | err/errx/warn/warnx do not need \n at the end
|
| 1.14 |
| 12-May-2002 |
wiz | Sync usage with man page synopsis. From Ryan Younce in bin/16644, with slight changes.
|
| 1.13 |
| 06-Nov-1998 |
christos | char -> unsigned char
|
| 1.12 |
| 25-Aug-1998 |
ross | Add { and } to shut up egcs. Reformat the more questionable code.
|
| 1.11 |
| 18-Oct-1997 |
lukem | WARNSify, fix .Nm usage, getopt returns -1 not EOF, deprecate register
|
| 1.10 |
| 11-Feb-1997 |
mrg | getopt returns -1 not EOF.
|
| 1.9 |
| 02-Sep-1995 |
jtc | Sync with 4.4lite2
|
| 1.8 |
| 26-Mar-1995 |
glass | Merged with 4.4Lite
|
| 1.7 |
| 20-Mar-1995 |
mycroft | Better-looking patch for a problem already fixed.
|
| 1.6 |
| 31-Dec-1993 |
jtc | Minor tweaks. The most significant problem of not being able to handle text files with infinately long lines (required by POSIX.2) has not been addressed.
|
| 1.5 |
| 27-Aug-1993 |
jtc | Minor tweaks: including header files to bring prototypes into scope, explicitly declaring function return values, etc. to make gcc -Wall shut up.
|
| 1.4 |
| 16-Aug-1993 |
jtc | Make cut 1003.2 compliant by adding -b and -n options. This was trivial, as we don't support multibyte characters yet.
|
| 1.3 |
| 01-Aug-1993 |
mycroft | Add RCS identifiers.
|
| 1.2 |
| 02-Apr-1993 |
cgd | Simon J. Gerraty <sjg@zen.void.oz.au>: cut -f1 outputs a field separator before the first field.
|
| 1.1 |
| 21-Mar-1993 |
cgd | branches: 1.1.1; Initial revision
|
| 1.1.1.3 |
| 02-Sep-1995 |
jtc | imported from 44lite2
|
| 1.1.1.2 |
| 26-Mar-1995 |
glass | Import from 4.4Lite
|
| 1.1.1.1 |
| 21-Mar-1993 |
cgd | initial import of 386bsd-0.1 sources
|
| 1.16.4.1 |
| 12-Aug-2006 |
riz | Pull up following revision(s) (requested by jnemeth in ticket #10672): usr.bin/cut/cut.1: revision 1.13-1.14,1.21 PR/33995: Aleksey Cheusov: support use "-" to indicate stdin from SUS don't highlight the single dash
|
| 1.17.2.1 |
| 12-Aug-2006 |
riz | Pull up following revision(s) (requested by jnemeth in ticket #1461): usr.bin/cut/cut.1: revision 1.13-1.14 usr.bin/cut/cut.c: revision 1.21 PR/33995: Aleksey Cheusov: support use "-" to indicate stdin from SUS don't highlight the single dash
|
| 1.23.4.1 |
| 09-Jan-2008 |
matt | sync with HEAD
|
| 1.24.6.1 |
| 18-Sep-2008 |
wrstuden | Sync with wrstuden-revivesa-base-2.
|
| 1.25.2.3 |
| 22-May-2014 |
yamt | sync with head.
for a reference, the tree before this commit was tagged as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
|
| 1.25.2.2 |
| 30-Oct-2012 |
yamt | sync with head
|
| 1.25.2.1 |
| 17-Apr-2012 |
yamt | sync with head
|
| 1.28.2.1 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|