rmyorston / busybox-w32

WIN32 native port of BusyBox.
https://frippery.org/busybox
Other
693 stars 126 forks source link

`sort`: support for sorting by version (`-V`) ? #370

Closed naksyl closed 10 months ago

naksyl commented 1 year ago

Usage has -V option but:

~ $ printf '%s\n' 1.1 1.11 1.2 | sort -V
sort: unknown sort type

I'm guessing MinGW lacks some libc/posix functions here

rmyorston commented 1 year ago

Yes, version sorting needs strverscmp, which is a GNU libc thing. We'd need to pull in an implementation.

rmyorston commented 1 year ago

I've copied strverscmp from musl libc.

sort -V should work now.