aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-10-09 17:51:25 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-10-09 17:51:25 +0000
commitabd97354d9837c11287c52eec774788a4148b590 (patch)
tree7b4551f795279bc25e2786f4774abb2191f1c37b
parent92fd0ee94cf3c120e7b777f85b7f24e60419ebd4 (diff)
downloadbusybox-w32-abd97354d9837c11287c52eec774788a4148b590.tar.gz
busybox-w32-abd97354d9837c11287c52eec774788a4148b590.tar.bz2
busybox-w32-abd97354d9837c11287c52eec774788a4148b590.zip
Apply a patch from Matt Kraai:
"The -L option to ls doesn't behave correctly for files listed explicitly on the command line, only those in directories that are listed. The appended patch fixes this problem. Would someone please commit it?" -Erik git-svn-id: svn://busybox.net/trunk/busybox@1172 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--coreutils/ls.c12
-rw-r--r--ls.c12
2 files changed, 22 insertions, 2 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 385d6b2de..8d975fd13 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -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);
diff --git a/ls.c b/ls.c
index 385d6b2de..8d975fd13 100644
--- a/ls.c
+++ b/ls.c
@@ -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);