Bug 26810

Summary: [PATCH] make cut(1) work with long lines
Product: Base System Reporter: dd <dd>
Component: binAssignee: dd <dd>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dd freebsd_committer freebsd_triage 2001-04-24 05:00:01 UTC
cut(1) cannot deal with lines longer than 2048 characters, and does
not properly deal with files that do not have a trailing newline.

Fix: The following patch fixes both of the cases described above.  Note
that specifying a list over 2048 on the command line (e.g., the -f
option) still isn't supported, but at least cut(1) doesn't choke when
you want the second token but feed it a few thousand characters in one
line.
How-To-Repeat: 
dima@spike% perl -e 'for ($i = 0; $i < 9000; $i++) { print "magic$i " }' > llt
dima@spike% cut -d\  -f2 llt
cut: llt: line too long.
dima@spike% echo -n "file with no trailing newline" > ntn
dima@spike% cut -d\  -f2 ntn
cut: ntn: line too long.
dima@spike%
Comment 1 dd freebsd_committer freebsd_triage 2001-04-27 00:22:49 UTC
State Changed
From-To: open->analyzed

Patch committed to -current.  I'll MFC, or bug someone to MFC, it later. 


Comment 2 dd freebsd_committer freebsd_triage 2001-04-27 00:22:49 UTC
Responsible Changed
From-To: freebsd-bugs->dd

My patch, my commit.
Comment 3 dd freebsd_committer freebsd_triage 2001-07-02 02:10:42 UTC
State Changed
From-To: analyzed->closed

MFC'd