Bug 187083 - [patch] sort(1) cannot be used for binary data.
Summary: [patch] sort(1) cannot be used for binary data.
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-26 14:40 UTC by Shayan Pooya
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Attachments
file.diff (412 bytes, patch)
2014-02-26 14:40 UTC, Shayan Pooya
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shayan Pooya 2014-02-26 14:40:01 UTC
Sort has an unnecessary check that prevents it from being used for binary data:
https://github.com/freebsd/freebsd/blob/master/usr.bin/sort/sort.c#L1063


Here is the mailing list discussion (not very useful):
http://freebsd.1045724.n5.nabble.com/Field-delimiter-in-sort-program-in-freebsd-td5879776.html

Fix: Just remove the bogus condition:

How-To-Repeat: $ sort -t $'\xff'

complains about the delimiter.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:18 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped