[BusyBox] BUG: du -l reversed

Seth W. Klein sk at sethwklein.net
Mon Mar 8 04:58:56 UTC 2004


As of v1.00-pre8 (and CVS just now when I checked using the web) the -l
switch to du is reversed.  Without the switch, du counts all hardlinks;
with it it counts only the first.  The correct behaviour is opposite.
This patch should fix it and works for me.

--- coreutils/du.c	2003-06-20 05:01:52.000000000 -0400
+++ coreutils/du.c-l-works	2004-03-07 23:35:27.000000000 -0500
@@ -56,7 +56,7 @@
 #endif
 
 static int max_print_depth = INT_MAX;
-static int count_hardlinks = INT_MAX;
+static int count_hardlinks = 1;
 
 static int status
 #if EXIT_SUCCESS == 0
@@ -234,7 +234,7 @@
 	}
 	if((opt & (1 << 7))) {
 		/* -l opt */
-		count_hardlinks = 1;
+		count_hardlinks = INT_MAX;
 	}
 	print_final_total = opt & (1 << 8); /* -c opt */
 
cheers,
Seth W. Klein
-- 
sk at sethwklein.net                         http://www.sethwklein.net/
Fix spam, get your ISP to implement SPF!       http://spf.pobox.com/



More information about the busybox mailing list