1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:07:45 +00:00

ls: Fix incorrect -t sort order

Dr. POSIX says -t should sort the output by mtime ascending.
This commit is contained in:
Andreas Kling 2021-05-25 13:23:17 +02:00
parent 6830963321
commit 7997c02b6c

View file

@ -398,8 +398,8 @@ static int do_file_system_object_long(const char* path)
quick_sort(files, [](auto& a, auto& b) {
if (flag_sort_by_timestamp) {
if (flag_reverse_sort)
return a.stat.st_mtime > b.stat.st_mtime;
return a.stat.st_mtime < b.stat.st_mtime;
return a.stat.st_mtime < b.stat.st_mtime;
return a.stat.st_mtime > b.stat.st_mtime;
}
// Fine, sort by name then!
if (flag_reverse_sort)