History log of /seL4-camkes-master/projects/musllibc/src/string/strverscmp.c
Revision Date Author Comments
# a5934142 22-Jun-2015 Rich Felker <dalias@aerifal.cx>

reimplement strverscmp to fix corner cases

this interface is non-standardized and is a GNU invention, and as
such, our implementation should match the behavior of the GNU
function. one peculiarity the old implementation got wrong was the
handling of all-zero digit sequences: they are supposed to compare
greater than digit sequences of which they are a proper prefix, as in
009 < 00.

in addition, high bytes were treated with char signedness rather than
as unsigned. this was wrong regardless of what the GNU function does
since the resulting order relation varied by arch.

the new strverscmp implementation makes explicit the cases where the
order differs from what strcmp would produce, of which there are only
two.


# 57174444 11-Dec-2013 Szabolcs Nagy <nsz@port70.net>

include cleanups: remove unused headers and add feature test macros


# 5afc74fb 25-Feb-2013 Rich Felker <dalias@aerifal.cx>

fix integer type issue in strverscmp

lenl-lenr is not a valid expression for a signed int return value from
strverscmp, since after implicit conversion from size_t to int this
difference could have the wrong sign or might even be zero. using the
difference for char values works since they're bounded well within the
range of differences representable by int, but it does not work for
size_t values.


# 4853c1f7 25-Feb-2013 Rich Felker <dalias@aerifal.cx>

implement non-stub strverscmp

patch by Isaac Dunham.


# a6540174 11-Sep-2011 Rich Felker <dalias@aerifal.cx>

add dummied strverscmp (obnoxious GNU function)

programs that use this tend to horribly botch international text
support, so it's questionable whether we want to support it even in
the long term... for now, it's just a dummy that calls strcmp.