aboutsummaryrefslogtreecommitdiff
path: root/ls.c
diff options
context:
space:
mode:
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 3b380671d..571c962c7 100644
--- a/ls.c
+++ b/ls.c
@@ -193,27 +193,34 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
193 fputs(" ", stdout); 193 fputs(" ", stdout);
194#ifdef BB_FEATURE_LS_USERNAME 194#ifdef BB_FEATURE_LS_USERNAME
195 if (!(opts & DISP_NUMERIC)) { 195 if (!(opts & DISP_NUMERIC)) {
196 scratch[8]='\0'; 196 scratch[0]='\0';
197 my_getpwuid( scratch, info->st_uid); 197 my_getpwuid( scratch, info->st_uid);
198 scratch[8]='\0';
198 if (*scratch) 199 if (*scratch)
199 fputs(scratch, stdout); 200 wr(scratch,8);
200 else 201 else {
201 writenum((long)info->st_uid,(short)0); 202 writenum((long) info->st_uid,(short)8);
203 fputs(" ", stdout);
204 }
202 } else 205 } else
203#endif 206#endif
204 writenum((long)info->st_uid,(short)0); 207 {
208 writenum((long) info->st_uid,(short)8);
209 fputs(" ", stdout);
210 }
205 tab(16); 211 tab(16);
206#ifdef BB_FEATURE_LS_USERNAME 212#ifdef BB_FEATURE_LS_USERNAME
207 if (!(opts & DISP_NUMERIC)) { 213 if (!(opts & DISP_NUMERIC)) {
208 scratch[8]='\0'; 214 scratch[0]='\0';
209 my_getgrgid( scratch, info->st_gid); 215 my_getgrgid( scratch, info->st_gid);
216 scratch[8]='\0';
210 if (*scratch) 217 if (*scratch)
211 fputs(scratch, stdout); 218 wr(scratch,8);
212 else 219 else
213 writenum((long)info->st_gid,(short)0); 220 writenum((long) info->st_gid,(short)8);
214 } else 221 } else
215#endif 222#endif
216 writenum((long)info->st_gid,(short)0); 223 writenum((long) info->st_gid,(short)8);
217 tab(17); 224 tab(17);
218 if (S_ISBLK(mode) || S_ISCHR(mode)) { 225 if (S_ISBLK(mode) || S_ISCHR(mode)) {
219 writenum((long)MAJOR(info->st_rdev),(short)3); 226 writenum((long)MAJOR(info->st_rdev),(short)3);