Email List: Xaustin-review-lX
[All Lists]

Defect in XCU sort

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XCU sort
From: yyyyyy@xxxxxxxxxxx
Date: Wed, 14 Dec 2005 22:05:33 GMT
        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.

<Prev in Thread] Current Thread [Next in Thread>