mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
ls: take into account "." and ".." when sorting
This commit is contained in:
parent
55a68bca80
commit
bcb9821e24
1 changed files with 2 additions and 5 deletions
|
@ -1732,8 +1732,6 @@ fn enter_directory(
|
|||
};
|
||||
|
||||
// Convert those entries to the PathData struct
|
||||
let mut vec_path_data = Vec::new();
|
||||
|
||||
for raw_entry in read_dir {
|
||||
let dir_entry = match raw_entry {
|
||||
Ok(path) => path,
|
||||
|
@ -1747,12 +1745,11 @@ fn enter_directory(
|
|||
if should_display(&dir_entry, config) {
|
||||
let entry_path_data =
|
||||
PathData::new(dir_entry.path(), Some(Ok(dir_entry)), None, config, false);
|
||||
vec_path_data.push(entry_path_data);
|
||||
entries.push(entry_path_data);
|
||||
};
|
||||
}
|
||||
|
||||
sort_entries(&mut vec_path_data, config, out);
|
||||
entries.append(&mut vec_path_data);
|
||||
sort_entries(&mut entries, config, out);
|
||||
|
||||
// Print total after any error display
|
||||
if config.format == Format::Long || config.alloc_size {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue