bore

basic core utilities (PD)
git clone git://bvnf.space/bore.git
Log | Files | Refs | README

commit 1071b4ab32e2320b651a013c0a1dfb8b9c46239c
parent 73104096d3cfadf6f5b91e6a397de08e132be65f
Author: phoebos <ben@bvnf.space>
Date:   Tue, 12 Oct 2021 18:34:04 +0100

ls: padding

Diffstat:
Mls.c | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ls.c b/ls.c @@ -75,7 +75,7 @@ printname(struct ent *e, int flags) { pretty_print_perms(e->mode); /* number of links */ - printf("%lu ", e->nlink); + printf("%4lu ", e->nlink); /* owner name */ errno = 0; @@ -86,10 +86,10 @@ printname(struct ent *e, int flags) { return 1; } else { /* couldn't find a user with that uid; print the numeric value */ - printf("%d ", e->uid); + printf("%-8d ", e->uid); } } else { - printf("%s ", pwd->pw_name); + printf("%-8.8s ", pwd->pw_name); } /* group name */ @@ -101,17 +101,17 @@ printname(struct ent *e, int flags) { return 1; } else { /* couldn't find a group with that gid; print the numeric value */ - printf("%d ", e->gid); + printf("%-8d ", e->gid); } } else { - printf("%s ", grp->gr_name); + printf("%-8.8s ", grp->gr_name); } /* size (or device info for character/block special files) */ if (S_ISBLK(e->mode) || S_ISCHR(e->mode)) - printf("%ld ", e->rdev); + printf("%8ld ", e->rdev); else - printf("%ld ", e->size); + printf("%8ld ", e->size); /* date and time */ }