Rockbox mail archive
Subject: Re: how is strnatcmp aka "Interpret numbers while sorting" supposed to sort?
Re: how is strnatcmp aka "Interpret numbers while sorting" supposed to sort?
Mike Holden wrote:
> Thomas Martitz wrote:
>> Thomas Martitz wrote:
>>> I've found a simpler solution for this. Trying the code raises the
>>> following problem:
>>> 00 < 0b < 01 < 1
>>> Zeros before except the final zeros are ignored, and the final zero
>>> before characters is not ignored. But the leading zeros of numbers are
>>> (so that 01 is 1). Obviously 0 sorts before 1.
>> Nautilus has this problem too. I don't know what windows does in this
> I thought we'd already established that those 4 files are in the right order?
> Windows orders them as below, which is the same as above:
I didn't establish anything, the mail about nautilus was sent before I
received yours. But if Nautilus and Windows sort this way, (and we want
to mimic it), then it's right, indeed.
Received on 2009-03-19
Page was last modified "Jan 10 2012" The Rockbox Crew