mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57: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
|
// Convert those entries to the PathData struct
|
||||||
let mut vec_path_data = Vec::new();
|
|
||||||
|
|
||||||
for raw_entry in read_dir {
|
for raw_entry in read_dir {
|
||||||
let dir_entry = match raw_entry {
|
let dir_entry = match raw_entry {
|
||||||
Ok(path) => path,
|
Ok(path) => path,
|
||||||
|
@ -1747,12 +1745,11 @@ fn enter_directory(
|
||||||
if should_display(&dir_entry, config) {
|
if should_display(&dir_entry, config) {
|
||||||
let entry_path_data =
|
let entry_path_data =
|
||||||
PathData::new(dir_entry.path(), Some(Ok(dir_entry)), None, config, false);
|
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);
|
sort_entries(&mut entries, config, out);
|
||||||
entries.append(&mut vec_path_data);
|
|
||||||
|
|
||||||
// Print total after any error display
|
// Print total after any error display
|
||||||
if config.format == Format::Long || config.alloc_size {
|
if config.format == Format::Long || config.alloc_size {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue