bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#55787: 29.0.50; inconsistent sort order with ls-lisp-version-lessp


From: Eli Zaretskii
Subject: bug#55787: 29.0.50; inconsistent sort order with ls-lisp-version-lessp
Date: Sat, 04 Jun 2022 10:44:04 +0300

> From: TAKAHASHI Yoshio <yfb02119@nifty.com>
> Date: Sat, 04 Jun 2022 08:21:48 +0900
> 
> I encounter an inconsistent sort result.  The position of "01.0" and/or
> "01.2" seems wrong.
> 
> 
> $ cat /tmp/test.el
> (require 'ls-lisp)
> (print (sort (vector "01.0" "10" "010" "01.2")
>              (lambda (x y)
>                (ls-lisp-version-lessp x y))))
> $ emacs -Q --batch -l /tmp/test.el
> 
> ["01.0" "10" "010" "01.2"]

Why do you think this is wrong?  This function is not meant to compare
dotted versions with undotted ones, only dotted to dotted or undotted
to undotted.  The strings are supposed to be file names, where a dot
begins an extension.

See the node "More details about version sort" in the GNU Coreutils
manual for more info.

If you want a general-purpose version-comparison function, use
version< instead.





reply via email to

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