diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-11-23 21:38:12 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-11-23 21:38:12 +0000 |
commit | 394f764e7d059e979f72ba88c31f4fa94a252ebf (patch) | |
tree | 3663c1184286a33a63f1cc88cebe4c7a79f38314 /coreutils | |
parent | cb41c2e83b9e9997b9737d7061d53f7c11a463a8 (diff) | |
download | busybox-w32-394f764e7d059e979f72ba88c31f4fa94a252ebf.tar.gz busybox-w32-394f764e7d059e979f72ba88c31f4fa94a252ebf.tar.bz2 busybox-w32-394f764e7d059e979f72ba88c31f4fa94a252ebf.zip |
Stuf
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/cat.c | 4 | ||||
-rw-r--r-- | coreutils/ls.c | 27 |
2 files changed, 18 insertions, 13 deletions
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) | |||
49 | argv++; | 49 | argv++; |
50 | 50 | ||
51 | while (argc-- > 0) { | 51 | while (argc-- > 0) { |
52 | file = fopen(*argv, "r"); | 52 | file = fopen(*(argv++), "r"); |
53 | if (file == NULL) { | 53 | if (file == NULL) { |
54 | perror(*argv); | 54 | perror(*argv); |
55 | exit(FALSE); | 55 | exit(FALSE); |
56 | } | 56 | } |
57 | print_file( file); | 57 | print_file( file); |
58 | argc--; | ||
59 | argv++; | ||
60 | } | 58 | } |
61 | exit(TRUE); | 59 | exit(TRUE); |
62 | } | 60 | } |
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 | |||
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); |