From 394f764e7d059e979f72ba88c31f4fa94a252ebf Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 23 Nov 1999 21:38:12 +0000 Subject: Stuf --- coreutils/cat.c | 4 +--- coreutils/ls.c | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'coreutils') diff --git a/coreutils/cat.c b/coreutils/cat.c index 1f4ef4af8..758a83e6b 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -49,14 +49,12 @@ extern int cat_main(int argc, char **argv) argv++; while (argc-- > 0) { - file = fopen(*argv, "r"); + file = fopen(*(argv++), "r"); if (file == NULL) { perror(*argv); exit(FALSE); } print_file( file); - argc--; - argv++; } exit(TRUE); } diff --git a/coreutils/ls.c b/coreutils/ls.c index 3b380671d..571c962c7 100644 --- a/coreutils/ls.c +++ b/coreutils/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); -- cgit v1.2.3