Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 3 Mar 2015 21:27:26 +0200
From: Sergey Dmitrouk <sdmitrouk@...esssoftek.com>
To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: Re: [PATCH] conforming strverscmp() implementation

On Tue, Mar 03, 2015 at 07:54:11AM -0800, Rich Felker wrote:
> Have you run libc-test against it and checked that it
> fixes all the test failures there? I would guess it does since they're
> based on the man page examples but it would be good to double-check
> anyway if you haven't.

Yes, related libc-test regression tests pass now.  I also compared
results with glibc implementation and it seems to be correct for
numbers, but I just run check again in directory with some non-ASCII file
names and got:

glibc:      . .. 000 00 01 010 02 03 04 05 06 07 08 09 0 1 3 9 10 11 русские буквы в имени
musl (new): русские буквы в имени . .. 000 00 01 010 02 03 04 05 06 07 08 09 0 1 3 9 10 11
musl (old): русские буквы в имени . .. 0 00 000 01 010 02 03 04 05 06 07 08 09 1 3 9 10 11

You can see that sorting of Cyrillic file names differs from glibc in
UTF-8 locale.  I believe it's another bug and this one is related to:

    return (*l - *r);

which should be changed (maybe even for 1.1.6) to something equivalent to:

    return ((unsigned char)*l - (unsigned char)*r);

in which case results become:

glibc:      . .. 000 00 01 010 02 03 04 05 06 07 08 09 0 1 3 9 10 11 русские буквы в имени
musl (new): . .. 000 00 01 010 02 03 04 05 06 07 08 09 0 1 3 9 10 11 русские буквы в имени
musl (old): . .. 0 00 000 01 010 02 03 04 05 06 07 08 09 1 3 9 10 11 русские буквы в имени

-- 
Sergey

View attachment "strverscmp.c" of type "text/plain" (1091 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.