about summary refs log tree commit diff
path: root/src/thread
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-06-23 00:12:25 +0000
committerRich Felker <dalias@aerifal.cx>2015-06-23 00:29:57 +0000
commita59341420fdedb288d9ff80e73609ae44e9cf258 (patch)
tree558bcbc501cbe1be079db3c8cc4aa7383200a703 /src/thread
parent153e952e1a688859d7095345b17e6c1df74a295c (diff)
downloadmusl-a59341420fdedb288d9ff80e73609ae44e9cf258.tar.gz
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 'src/thread')
0 files changed, 0 insertions, 0 deletions