diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-06-30 17:54:20 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-06-30 17:54:20 +0000 |
commit | 8fa1bf7cd6fefc5ac3fb13eb85569d874e84f88e (patch) | |
tree | 43429320725f98c02c919d934c1f6b5961cad93b | |
parent | 8f0183938667c570f3ae3e3a6ab9be68676735ce (diff) | |
download | busybox-8fa1bf7cd6fefc5ac3fb13eb85569d874e84f88e.tar.gz |
Fix a silly logic error which caused symlinks to be printed twice, and
wrongly caused the return code to be an error.
-Erik
-rw-r--r-- | coreutils/du.c | 9 | ||||
-rw-r--r-- | du.c | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/coreutils/du.c b/coreutils/du.c index 1966e3559..fb649aee5 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -149,8 +149,8 @@ static long du(char *filename) /* Don't add in stuff pointed to by symbolic links */ if (S_ISLNK(statbuf.st_mode)) { sum = 0L; - if (du_depth == 1) - print(sum, filename); + if (du_depth == 1) { + } } if (S_ISDIR(statbuf.st_mode)) { DIR *dir; @@ -236,8 +236,7 @@ int du_main(int argc, char **argv) long sum; for (i=optind; i < argc; i++) { - if ((sum = du(argv[i])) == 0) - status = EXIT_FAILURE; + sum = du(argv[i]); if(is_directory(argv[i], FALSE, NULL)==FALSE) { print_normal(sum, argv[i]); } @@ -248,7 +247,7 @@ int du_main(int argc, char **argv) return status; } -/* $Id: du.c,v 1.49 2001/06/13 08:02:44 andersen Exp $ */ +/* $Id: du.c,v 1.50 2001/06/30 17:54:20 andersen Exp $ */ /* Local Variables: c-file-style: "linux" @@ -149,8 +149,8 @@ static long du(char *filename) /* Don't add in stuff pointed to by symbolic links */ if (S_ISLNK(statbuf.st_mode)) { sum = 0L; - if (du_depth == 1) - print(sum, filename); + if (du_depth == 1) { + } } if (S_ISDIR(statbuf.st_mode)) { DIR *dir; @@ -236,8 +236,7 @@ int du_main(int argc, char **argv) long sum; for (i=optind; i < argc; i++) { - if ((sum = du(argv[i])) == 0) - status = EXIT_FAILURE; + sum = du(argv[i]); if(is_directory(argv[i], FALSE, NULL)==FALSE) { print_normal(sum, argv[i]); } @@ -248,7 +247,7 @@ int du_main(int argc, char **argv) return status; } -/* $Id: du.c,v 1.49 2001/06/13 08:02:44 andersen Exp $ */ +/* $Id: du.c,v 1.50 2001/06/30 17:54:20 andersen Exp $ */ /* Local Variables: c-file-style: "linux" |