GNU bug report logs - #35939
version sort is incorrect with hyphen-minus

Previous Next

Package: coreutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Tue, 28 May 2019 00:55:01 UTC

Severity: normal

Full log


Message #20 received at 35939 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Lefevre <vincent <at> vinc17.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 35939 <at> debbugs.gnu.org, Assaf Gordon <assafgordon <at> gmail.com>,
 Ian Jackson <ijackson <at> chiark.greenend.org.uk>
Subject: Re: bug#35939: version sort is incorrect with hyphen-minus
Date: Wed, 26 Jun 2019 23:25:44 +0200
On 2019-06-26 12:57:14 -0700, Paul Eggert wrote:
> GNU sort uses the same algorithm as glibc strverscmp, and this algorithm has
> changed only once since strverscmp was added to glibc in 1997. The change
> was made in 2009, to fix this bug:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=9913

Except that this bug report is wrong. But I've checked that
both "ls -v" and "sort -V" give the expected ordering on the
given example in this bug report:

zira% ls -1v                
B007502280067.gbp.corp.com
B007502357019.GBP.CORP.COM
B0075022800016.gbp.corp.com

zira% printf "%s\n" * | sort -V
B007502280067.gbp.corp.com
B007502357019.GBP.CORP.COM
B0075022800016.gbp.corp.com

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




This bug report was last modified 5 years and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.