From cd9aae35d593d49430d05fb223a91fbfbbbd6456 Mon Sep 17 00:00:00 2001 From: andersen Date: Sun, 7 Nov 1999 07:38:08 +0000 Subject: init and ls -l fixes git-svn-id: svn://busybox.net/trunk/busybox@85 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- ls.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ls.c') diff --git a/ls.c b/ls.c index 0cde1960f..4eb486f87 100644 --- a/ls.c +++ b/ls.c @@ -206,7 +206,7 @@ static char append_char(mode_t mode) ** **/ -static void list_single(const char *name, struct stat *info) +static void list_single(const char *name, struct stat *info, const char *fullname) { char scratch[PATH_MAX]; short len = strlen(name); @@ -297,12 +297,12 @@ static void list_single(const char *name, struct stat *info) wr(name, len); if (S_ISLNK(mode)) { wr(" -> ", 4); - len = readlink(name, scratch, sizeof scratch); + len = readlink(fullname, scratch, sizeof scratch); if (len > 0) fwrite(scratch, 1, len, stdout); #ifdef FEATURE_FILETYPECHAR /* show type of destination */ if (opts & DISP_FTYPE) { - if (!stat(name, info)) { + if (!stat(fullname, info)) { append = append_char(info->st_mode); if (append) fputc(append, stdout); @@ -372,7 +372,7 @@ static int list_item(const char *name) if (!S_ISDIR(info.st_mode) || (opts & DIR_NOLIST)) { - list_single(name, &info); + list_single(name, &info, name); return 0; } @@ -424,7 +424,7 @@ static int list_item(const char *name) strcpy(fnend, entry->d_name); if (lstat(fullname, &info)) goto direrr; /* (shouldn't fail) */ - list_single(entry->d_name, &info); + list_single(entry->d_name, &info, fullname); } closedir(dir); return 0; -- cgit v1.2.3-55-g6feb