Commit graph

2 commits

Author SHA1 Message Date
Mina Galić
4c509ef95c libc: fix history for strverscmp(3) and versionsort(3)
PR:		273401
Approved by:	re (gjb)

(cherry picked from commit 09ec5e67a7a6605e5a58a2e3e82dab243a90609a)
2023-09-03 19:06:36 +03:00
Aymeric Wibo
05c9a0158f libc: Add strverscmp(3) and versionsort(3)
Add a strverscmp(3) function to libc, a GNU extension I implemented by
reading its glibc manual page. It orders strings following a much more
natural ordering (e.g. "ent1 < ent2 < ent10" as opposed to
"ent1 < ent10 < ent2" with strcmp(3)'s lexicographic ordering).

Also add versionsort(3) for use as scandir(3)'s compar argument.

Update manual page for scandir(3) and add one for strverscmp(3).

Reviewed by:	pstef, gbe, kib
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D35807
2022-08-25 03:29:03 +03:00