aboutsummaryrefslogtreecommitdiff
path: root/coreutils/du.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-02-11 21:55:04 +0000
committerErik Andersen <andersen@codepoet.org>2000-02-11 21:55:04 +0000
commit9ffdaa647ee57263247e047e6c67c5a7fa1f2a6c (patch)
tree3485e1645439990642fcb941d579deb10f8a17a7 /coreutils/du.c
parent5e1b2ca1161cba481ccf4873427389f59dbc23e0 (diff)
downloadbusybox-9ffdaa647ee57263247e047e6c67c5a7fa1f2a6c.tar.gz
Updates
-Erik
Diffstat (limited to 'coreutils/du.c')
-rw-r--r--coreutils/du.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/coreutils/du.c b/coreutils/du.c
index 7151e3a9c..912605882 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -72,6 +72,10 @@ static long du(char *filename)
du_depth++;
sum = statbuf.st_blocks;
+ /* Don't add in stuff pointed to by links */
+ if (S_ISLNK(statbuf.st_mode)) {
+ return 0;
+ }
if (S_ISDIR(statbuf.st_mode)) {
DIR *dir;
struct dirent *entry;
@@ -140,7 +144,7 @@ int du_main(int argc, char **argv)
for (; i < argc; i++) {
sum = du(argv[i]);
- if ((sum) && (isDirectory(argv[i], FALSE))) {
+ if ((sum) && (isDirectory(argv[i], FALSE, NULL))) {
print_normal(sum, argv[i]);
}
}
@@ -149,4 +153,4 @@ int du_main(int argc, char **argv)
exit(0);
}
-/* $Id: du.c,v 1.11 2000/02/08 19:58:47 erik Exp $ */
+/* $Id: du.c,v 1.12 2000/02/11 21:55:04 erik Exp $ */