[git commit] ls: fix HAVE_STRVERSCMP check; add check for older uclibc versions

Denys Vlasenko vda.linux at googlemail.com
Tue Jun 21 15:12:52 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=1e18a01fa2965ef967b99d519018e21c9b5f15af
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/ls.c     |    2 +-
 include/platform.h |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/coreutils/ls.c b/coreutils/ls.c
index 6080f59..f11eb43 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -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
diff --git a/include/platform.h b/include/platform.h
index d6b7488..cbe85f4 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -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
-- 
1.7.3.4



More information about the busybox-cvs mailing list