bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in comm --check-order


From: Bruno Haible
Subject: bug in comm --check-order
Date: Sat, 7 Mar 2009 13:30:31 +0100
User-agent: KMail/1.9.9

"comm --check-order" does not detect all cases of misordered input.

$ cat foo1 
Reaganomics
Reagan
$ cat foo2
Reaganomics
Reagan
Clinton
$ comm --check-order foo1 foo2
                Reaganomics
                Reagan
comm: file 2 is not in sorted order
$ comm --check-order foo2 foo1
                Reaganomics
                Reagan
comm: file 1 is not in sorted order
$ comm --check-order foo1 foo1
                Reaganomics
                Reagan

As you can see, File foo1 is being considered well-ordered. Likewise this file:

$ cat foo
Reagan
Reaganom
R
Richard
R
Reaganomics
Reagan
$ comm --check-order foo foo
                Reagan
                Reaganom
                R
                Richard
                R
                Reaganomics
                Reagan

Attached is a fix. Feel free to add a unit test for this; I'm not familiar
enough with coreutils to do that.

Bruno

Attachment: coreutils-7.1-comm-fix.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]