Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



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?

From: Thomas Martitz <thomas.martitz_at_fhtw-berlin.de>
Date: Thu, 19 Mar 2009 17:15:05 +0100

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
>> case.
>>
>>
>
> 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:
> 00
> 0b
> 01
> 1
>
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
aaa