Defect report from : Paul Eggert , UCLA
(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)
@ page 871 line 33844 section sort objection {20051214a}
Problem:
Edition of Specification (Year): 2004
Defect code : 1. Error
sort's -i and -n options are incompatible in practice, but the
specification for 'sort' does not make this clear.
For example, suppose '$' represents a non-printable character, and the
input contains this data:
$-10
$ -20
$-15
If this is sorted with "sort -i -n", then the '$'s should be ignored
because of the -i, and the output should look like this:
$ -20
$-15
$-10
However, existing "sort" implementations (e.g., Solaris 10 sort, GNU
sort) do not behave this way: they act as if -i was not specified, so
the numeric data stops at the '$' and it is as if all the numbers were
zero.
Action:
Insert the following after XCU page 871 line 33844 (sort -i):
The behavior is undefined for a sort key for which -n also applies.
|