From 43f3f7e01c0707d6617ec5239f683d2f6790a498 Mon Sep 17 00:00:00 2001 From: Alessandro Stoltenberg Date: Sun, 25 Apr 2021 20:13:42 +0200 Subject: [PATCH] feat2: Rebased on current master and incorporated changes done to the filetype handling. --- src/uu/ls/src/ls.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 145ed0428..3cd1e037d 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -1165,9 +1165,10 @@ fn sort_entries(entries: &mut Vec, config: &Config) { Sort::Name => entries.sort_by_cached_key(|k| k.file_name.to_lowercase()), Sort::Version => entries.sort_by(|k, j| version_cmp::version_cmp(&k.p_buf, &j.p_buf)), Sort::Extension => entries.sort_by(|a, b| { - a.extension() - .cmp(&b.extension()) - .then(a.file_stem().cmp(&b.file_stem())) + a.p_buf + .extension() + .cmp(&b.p_buf.extension()) + .then(a.p_buf.file_stem().cmp(&b.p_buf.file_stem())) }), Sort::None => {} }