Skip to content

Commit

Permalink
ls: Left justify owner and group information in long format
Browse files Browse the repository at this point in the history
  • Loading branch information
tcl3 authored and awesomekling committed Sep 27, 2023
1 parent cb1851f commit 938a287
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Userland/Utilities/ls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,18 @@ static bool print_filesystem_object(DeprecatedString const& path, DeprecatedStri
if (!flag_hide_owner) {
auto username = users.get(st.st_uid);
if (!flag_print_numeric && username.has_value()) {
printf(" %7s", username.value().characters());
printf(" %-7s", username.value().characters());
} else {
printf(" %7u", st.st_uid);
printf(" %-7u", st.st_uid);
}
}

if (!flag_hide_group) {
auto groupname = groups.get(st.st_gid);
if (!flag_print_numeric && groupname.has_value()) {
printf(" %7s", groupname.value().characters());
printf(" %-7s", groupname.value().characters());
} else {
printf(" %7u", st.st_gid);
printf(" %-7u", st.st_gid);
}
}

Expand Down

0 comments on commit 938a287

Please sign in to comment.