aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
authormarkw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-30 18:17:00 +0000
committermarkw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-30 18:17:00 +0000
commitdb1ea6ee76a5106c45398bdc17c2db04da99ecf7 (patch)
treea90a2bc3c3815f7f0e70f009b9b175736902a848 /coreutils/ls.c
parentc9a51e8d05d64580a0f9ccce5b77c5b4ad990541 (diff)
downloadbusybox-w32-db1ea6ee76a5106c45398bdc17c2db04da99ecf7.tar.gz
busybox-w32-db1ea6ee76a5106c45398bdc17c2db04da99ecf7.tar.bz2
busybox-w32-db1ea6ee76a5106c45398bdc17c2db04da99ecf7.zip
Made new xreadlink function for libbb and changed applets to use it instead of
readlink(2). git-svn-id: svn://busybox.net/trunk/busybox@2495 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r--coreutils/ls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index d24ba9866..c13b225fa 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -577,7 +577,7 @@ static struct dnode **list_dir(char *path)
577/*----------------------------------------------------------------------*/ 577/*----------------------------------------------------------------------*/
578static int list_single(struct dnode *dn) 578static int list_single(struct dnode *dn)
579{ 579{
580 int i, len; 580 int i;
581 char scratch[BUFSIZ + 1]; 581 char scratch[BUFSIZ + 1];
582#ifdef BB_FEATURE_LS_TIMESTAMPS 582#ifdef BB_FEATURE_LS_TIMESTAMPS
583 char *filetime; 583 char *filetime;
@@ -688,16 +688,16 @@ static int list_single(struct dnode *dn)
688 break; 688 break;
689 case LIST_SYMLINK: 689 case LIST_SYMLINK:
690 if (S_ISLNK(dn->dstat.st_mode)) { 690 if (S_ISLNK(dn->dstat.st_mode)) {
691 len= readlink(dn->fullname, scratch, (sizeof scratch)-1); 691 char *lpath = xreadlink(dn->fullname);
692 if (len > 0) { 692 if (lpath) {
693 scratch[len]= '\0'; 693 printf(" -> %s", lpath);
694 printf(" -> %s", scratch);
695#ifdef BB_FEATURE_LS_FILETYPES 694#ifdef BB_FEATURE_LS_FILETYPES
696 if (!stat(dn->fullname, &info)) { 695 if (!stat(dn->fullname, &info)) {
697 append = append_char(info.st_mode); 696 append = append_char(info.st_mode);
698 } 697 }
699#endif 698#endif
700 column += len+4; 699 column += strlen(lpath) + 4;
700 free(lpath);
701 } 701 }
702 } 702 }
703 break; 703 break;