diff options
Diffstat (limited to 'ls.c')
-rw-r--r-- | ls.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -790,7 +790,17 @@ extern int ls_main(int argc, char **argv) | |||
790 | for (oi=0 ; oi < ac; oi++) { | 790 | for (oi=0 ; oi < ac; oi++) { |
791 | cur= (struct dnode *)xmalloc(sizeof(struct dnode)); | 791 | cur= (struct dnode *)xmalloc(sizeof(struct dnode)); |
792 | cur->fullname= xstrdup(av[oi]); | 792 | cur->fullname= xstrdup(av[oi]); |
793 | cur->name= cur->fullname ; | 793 | cur->name= cur->fullname; |
794 | #ifdef BB_FEATURE_LS_FOLLOWLINKS | ||
795 | if (follow_links == TRUE) { | ||
796 | if (stat(av[oi], &cur->dstat)) { | ||
797 | errorMsg("%s: %s\n", av[oi], strerror(errno)); | ||
798 | free(cur->fullname); | ||
799 | free(cur); | ||
800 | continue; | ||
801 | } | ||
802 | } else | ||
803 | #endif | ||
794 | if (lstat(av[oi], &cur->dstat)) { /* get file info into node */ | 804 | if (lstat(av[oi], &cur->dstat)) { /* get file info into node */ |
795 | errorMsg("%s: %s\n", av[oi], strerror(errno)); | 805 | errorMsg("%s: %s\n", av[oi], strerror(errno)); |
796 | free(cur->fullname); | 806 | free(cur->fullname); |