diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-11-07 07:38:08 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-11-07 07:38:08 +0000 |
commit | 07e5297ca7707d2fd56ab2fa8e1ea0c9805035e3 (patch) | |
tree | 67473f996e985a255afbb8d20cb1583fe09f0b14 /coreutils/ls.c | |
parent | dc6301e7ca26457e413f1dfc88fca4d19e775970 (diff) | |
download | busybox-w32-07e5297ca7707d2fd56ab2fa8e1ea0c9805035e3.tar.gz busybox-w32-07e5297ca7707d2fd56ab2fa8e1ea0c9805035e3.tar.bz2 busybox-w32-07e5297ca7707d2fd56ab2fa8e1ea0c9805035e3.zip |
init and ls -l fixes
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r-- | coreutils/ls.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index 0cde1960f..4eb486f87 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -206,7 +206,7 @@ static char append_char(mode_t mode) | |||
206 | ** | 206 | ** |
207 | **/ | 207 | **/ |
208 | 208 | ||
209 | static void list_single(const char *name, struct stat *info) | 209 | static void list_single(const char *name, struct stat *info, const char *fullname) |
210 | { | 210 | { |
211 | char scratch[PATH_MAX]; | 211 | char scratch[PATH_MAX]; |
212 | short len = strlen(name); | 212 | short len = strlen(name); |
@@ -297,12 +297,12 @@ static void list_single(const char *name, struct stat *info) | |||
297 | wr(name, len); | 297 | wr(name, len); |
298 | if (S_ISLNK(mode)) { | 298 | if (S_ISLNK(mode)) { |
299 | wr(" -> ", 4); | 299 | wr(" -> ", 4); |
300 | len = readlink(name, scratch, sizeof scratch); | 300 | len = readlink(fullname, scratch, sizeof scratch); |
301 | if (len > 0) fwrite(scratch, 1, len, stdout); | 301 | if (len > 0) fwrite(scratch, 1, len, stdout); |
302 | #ifdef FEATURE_FILETYPECHAR | 302 | #ifdef FEATURE_FILETYPECHAR |
303 | /* show type of destination */ | 303 | /* show type of destination */ |
304 | if (opts & DISP_FTYPE) { | 304 | if (opts & DISP_FTYPE) { |
305 | if (!stat(name, info)) { | 305 | if (!stat(fullname, info)) { |
306 | append = append_char(info->st_mode); | 306 | append = append_char(info->st_mode); |
307 | if (append) | 307 | if (append) |
308 | fputc(append, stdout); | 308 | fputc(append, stdout); |
@@ -372,7 +372,7 @@ static int list_item(const char *name) | |||
372 | 372 | ||
373 | if (!S_ISDIR(info.st_mode) || | 373 | if (!S_ISDIR(info.st_mode) || |
374 | (opts & DIR_NOLIST)) { | 374 | (opts & DIR_NOLIST)) { |
375 | list_single(name, &info); | 375 | list_single(name, &info, name); |
376 | return 0; | 376 | return 0; |
377 | } | 377 | } |
378 | 378 | ||
@@ -424,7 +424,7 @@ static int list_item(const char *name) | |||
424 | strcpy(fnend, entry->d_name); | 424 | strcpy(fnend, entry->d_name); |
425 | if (lstat(fullname, &info)) | 425 | if (lstat(fullname, &info)) |
426 | goto direrr; /* (shouldn't fail) */ | 426 | goto direrr; /* (shouldn't fail) */ |
427 | list_single(entry->d_name, &info); | 427 | list_single(entry->d_name, &info, fullname); |
428 | } | 428 | } |
429 | closedir(dir); | 429 | closedir(dir); |
430 | return 0; | 430 | return 0; |