diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-06-23 00:12:25 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-06-23 00:29:57 +0000 |
commit | a59341420fdedb288d9ff80e73609ae44e9cf258 (patch) | |
tree | 558bcbc501cbe1be079db3c8cc4aa7383200a703 /include/byteswap.h | |
parent | 153e952e1a688859d7095345b17e6c1df74a295c (diff) | |
download | musl-a59341420fdedb288d9ff80e73609ae44e9cf258.tar.gz musl-a59341420fdedb288d9ff80e73609ae44e9cf258.tar.bz2 musl-a59341420fdedb288d9ff80e73609ae44e9cf258.tar.xz musl-a59341420fdedb288d9ff80e73609ae44e9cf258.zip |
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.
Diffstat (limited to 'include/byteswap.h')
0 files changed, 0 insertions, 0 deletions