ls: fix HAVE_STRVERSCMP check; add check for older uclibc versions

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-06-21 17:12:52 +02:00
parent 33092f1003
commit 1e18a01fa2
2 changed files with 11 additions and 1 deletions

View File

@ -886,7 +886,7 @@ static int sortcmp(const void *a, const void *b)
if (sort_opts == SORT_DIR) {
dif = S_ISDIR(d2->dn_mode) - S_ISDIR(d1->dn_mode);
} else
#ifdef HAVE_STRVERSCMP && HAVE_STRVERSCMP == 1
#if defined(HAVE_STRVERSCMP) && HAVE_STRVERSCMP == 1
if (sort_opts == SORT_VERSION) {
dif = strverscmp(d1->name, d2->name);
} else

View File

@ -359,6 +359,16 @@ typedef unsigned smalluint;
# undef HAVE_NET_ETHERNET_H
#endif
#if defined(__UCLIBC_MAJOR__)
# if __UCLIBC_MAJOR__ == 0 \
&& ( __UCLIBC_MINOR__ < 9 \
|| (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 31) \
)
# undef HAVE_STRVERSCMP
# endif
#endif
#if defined(__dietlibc__)
# undef HAVE_STRCHRNUL
#endif