summaryrefslogtreecommitdiff
path: root/ls.c
diff options
context:
space:
mode:
authorEric Andersen1999-11-23 21:38:12 +0000
committerEric Andersen1999-11-23 21:38:12 +0000
commit394f764e7d059e979f72ba88c31f4fa94a252ebf (patch)
tree3663c1184286a33a63f1cc88cebe4c7a79f38314 /ls.c
parentcb41c2e83b9e9997b9737d7061d53f7c11a463a8 (diff)
downloadbusybox-394f764e7d059e979f72ba88c31f4fa94a252ebf.zip
busybox-394f764e7d059e979f72ba88c31f4fa94a252ebf.tar.gz
Stuf
Diffstat (limited to 'ls.c')
-rw-r--r--ls.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/ls.c b/ls.c
index 3b38067..571c962 100644
--- a/ls.c
+++ b/ls.c
@@ -193,27 +193,34 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
fputs(" ", stdout);
#ifdef BB_FEATURE_LS_USERNAME
if (!(opts & DISP_NUMERIC)) {
- scratch[8]='\0';
+ scratch[0]='\0';
my_getpwuid( scratch, info->st_uid);
+ scratch[8]='\0';
if (*scratch)
- fputs(scratch, stdout);
- else
- writenum((long)info->st_uid,(short)0);
+ wr(scratch,8);
+ else {
+ writenum((long) info->st_uid,(short)8);
+ fputs(" ", stdout);
+ }
} else
#endif
- writenum((long)info->st_uid,(short)0);
+ {
+ writenum((long) info->st_uid,(short)8);
+ fputs(" ", stdout);
+ }
tab(16);
#ifdef BB_FEATURE_LS_USERNAME
if (!(opts & DISP_NUMERIC)) {
- scratch[8]='\0';
+ scratch[0]='\0';
my_getgrgid( scratch, info->st_gid);
+ scratch[8]='\0';
if (*scratch)
- fputs(scratch, stdout);
- else
- writenum((long)info->st_gid,(short)0);
+ wr(scratch,8);
+ else
+ writenum((long) info->st_gid,(short)8);
} else
#endif
- writenum((long)info->st_gid,(short)0);
+ writenum((long) info->st_gid,(short)8);
tab(17);
if (S_ISBLK(mode) || S_ISCHR(mode)) {
writenum((long)MAJOR(info->st_rdev),(short)3);