du: don't count duplicate arguments. Closes 5288
Since coreutils 8.6 (2010-10-15) du no longer counts duplicate arguments.
Revert the relevant part of commit 618a3027ed (du: fix "du /dir /dir"
case).
function                                             old     new   delta
du_main                                              302     297      -5
reset_ino_dev_hashtable                               78       -     -78
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-83)             Total: -83 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Denys Vlasenko
					
				
			
			
				
	
			
			
			
						parent
						
							8502fa8747
						
					
				
				
					commit
					e563f9e851
				
			@@ -290,11 +290,11 @@ int du_main(int argc UNUSED_PARAM, char **argv)
 | 
			
		||||
	total = 0;
 | 
			
		||||
	do {
 | 
			
		||||
		total += du(*argv);
 | 
			
		||||
		/* otherwise du /dir /dir won't show /dir twice: */
 | 
			
		||||
		reset_ino_dev_hashtable();
 | 
			
		||||
		G.slink_depth = slink_depth_save;
 | 
			
		||||
	} while (*++argv);
 | 
			
		||||
 | 
			
		||||
	if (ENABLE_FEATURE_CLEAN_UP)
 | 
			
		||||
		reset_ino_dev_hashtable();
 | 
			
		||||
	if (opt & OPT_c_total)
 | 
			
		||||
		print(total, "total");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user