strverscmp("gliv-1.0", "gliv-1.0.1") => -46 => Good strverscmp("gliv-1.0.tar.gz", "gliv-1.0.1.tar.gz") => 67 => Bad Given that strverscmp is mainly used to sort filenames of versionned projects, it should apply the same order with or without a suffix.
The strverscmp function really can't change at this point, it is well documented how it behaves and programs rely on its behavior. strverscmp only cares about the longest substring containing consecutive digits around the first differing byte, so not even dots mean anything to it. You are looking for a function like rpmvercmp in <rpm/rpmlib.h> which provides segmented comparison. But why should that be in libc?
Thanks for pointing me out rpmvercmp. If you don't want to change the strverscmp behaviour, then the bug should be closed I think.
strverscmp cannot be changed. And it's simply not meant to do the kind of comparisons you expect it to do.