Menu

#334 sort drops some output lines

TextUtils
open
nobody
Binaries (396)
5
2012-07-26
2006-08-04
sgp
No

On Windows XP Pro service pack 2, the following test
case (file uu below) shows that sort incorrectly
drops (eats up) an output line.

This bug seems to be related to option -u, as running
the same test case with option -u removed returns
correct output (but removing -u isn't a work-around
for this bug).

Begin saved console screen buffer: 8/4/2006

C:>sort --version
sort (GNU coreutils) 5.3.0
Written by Mike Haertel and Paul Eggert.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

C:>cat --version
cat (GNU coreutils) 5.3.0
Written by Torbjorn Granlund and Richard M. Stallman.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

C:>cat uu
?x?z
a
?y?c
b

C:>sort --field-separator=? --key=3 --key=2r -f -u uu
a
?y?c
?x?z

C:>sort --field-separator=? --key=3 --key=2r -f uu
a
b
?y?c
?x?z


End saved console screen buffer: 8/4/2006

Discussion