summaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r--coreutils/ls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index c42f5f3..6080f59 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -886,9 +886,11 @@ 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 (sort_opts == SORT_VERSION) {
dif = strverscmp(d1->name, d2->name);
} else
+#endif
if (sort_opts == SORT_EXT) {
dif = strcmp(strchrnul(d1->name, '.'), strchrnul(d2->name, '.'));
}