diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-30 17:54:20 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-30 17:54:20 +0000 |
commit | 86de95163fe81cd315c853a43eeaa6aaa75f0d2a (patch) | |
tree | 43429320725f98c02c919d934c1f6b5961cad93b | |
parent | feba8092d0fc76dd309d833d5a00c5493063213f (diff) | |
download | busybox-w32-86de95163fe81cd315c853a43eeaa6aaa75f0d2a.tar.gz busybox-w32-86de95163fe81cd315c853a43eeaa6aaa75f0d2a.tar.bz2 busybox-w32-86de95163fe81cd315c853a43eeaa6aaa75f0d2a.zip |
Fix a silly logic error which caused symlinks to be printed twice, and
wrongly caused the return code to be an error.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@2959 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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) | |||
149 | /* Don't add in stuff pointed to by symbolic links */ | 149 | /* Don't add in stuff pointed to by symbolic links */ |
150 | if (S_ISLNK(statbuf.st_mode)) { | 150 | if (S_ISLNK(statbuf.st_mode)) { |
151 | sum = 0L; | 151 | sum = 0L; |
152 | if (du_depth == 1) | 152 | if (du_depth == 1) { |
153 | print(sum, filename); | 153 | } |
154 | } | 154 | } |
155 | if (S_ISDIR(statbuf.st_mode)) { | 155 | if (S_ISDIR(statbuf.st_mode)) { |
156 | DIR *dir; | 156 | DIR *dir; |
@@ -236,8 +236,7 @@ int du_main(int argc, char **argv) | |||
236 | long sum; | 236 | long sum; |
237 | 237 | ||
238 | for (i=optind; i < argc; i++) { | 238 | for (i=optind; i < argc; i++) { |
239 | if ((sum = du(argv[i])) == 0) | 239 | sum = du(argv[i]); |
240 | status = EXIT_FAILURE; | ||
241 | if(is_directory(argv[i], FALSE, NULL)==FALSE) { | 240 | if(is_directory(argv[i], FALSE, NULL)==FALSE) { |
242 | print_normal(sum, argv[i]); | 241 | print_normal(sum, argv[i]); |
243 | } | 242 | } |
@@ -248,7 +247,7 @@ int du_main(int argc, char **argv) | |||
248 | return status; | 247 | return status; |
249 | } | 248 | } |
250 | 249 | ||
251 | /* $Id: du.c,v 1.49 2001/06/13 08:02:44 andersen Exp $ */ | 250 | /* $Id: du.c,v 1.50 2001/06/30 17:54:20 andersen Exp $ */ |
252 | /* | 251 | /* |
253 | Local Variables: | 252 | Local Variables: |
254 | c-file-style: "linux" | 253 | c-file-style: "linux" |
@@ -149,8 +149,8 @@ static long du(char *filename) | |||
149 | /* Don't add in stuff pointed to by symbolic links */ | 149 | /* Don't add in stuff pointed to by symbolic links */ |
150 | if (S_ISLNK(statbuf.st_mode)) { | 150 | if (S_ISLNK(statbuf.st_mode)) { |
151 | sum = 0L; | 151 | sum = 0L; |
152 | if (du_depth == 1) | 152 | if (du_depth == 1) { |
153 | print(sum, filename); | 153 | } |
154 | } | 154 | } |
155 | if (S_ISDIR(statbuf.st_mode)) { | 155 | if (S_ISDIR(statbuf.st_mode)) { |
156 | DIR *dir; | 156 | DIR *dir; |
@@ -236,8 +236,7 @@ int du_main(int argc, char **argv) | |||
236 | long sum; | 236 | long sum; |
237 | 237 | ||
238 | for (i=optind; i < argc; i++) { | 238 | for (i=optind; i < argc; i++) { |
239 | if ((sum = du(argv[i])) == 0) | 239 | sum = du(argv[i]); |
240 | status = EXIT_FAILURE; | ||
241 | if(is_directory(argv[i], FALSE, NULL)==FALSE) { | 240 | if(is_directory(argv[i], FALSE, NULL)==FALSE) { |
242 | print_normal(sum, argv[i]); | 241 | print_normal(sum, argv[i]); |
243 | } | 242 | } |
@@ -248,7 +247,7 @@ int du_main(int argc, char **argv) | |||
248 | return status; | 247 | return status; |
249 | } | 248 | } |
250 | 249 | ||
251 | /* $Id: du.c,v 1.49 2001/06/13 08:02:44 andersen Exp $ */ | 250 | /* $Id: du.c,v 1.50 2001/06/30 17:54:20 andersen Exp $ */ |
252 | /* | 251 | /* |
253 | Local Variables: | 252 | Local Variables: |
254 | c-file-style: "linux" | 253 | c-file-style: "linux" |