From: Glenn L McGrath Date: Wed, 10 Mar 2004 09:58:51 +0000 (-0000) Subject: When displaying the size in 1kB blocks round up if an odd number of X-Git-Tag: 1_00_pre9~75 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c66ebe4200af584b9101bcadc4a11509db8318a1;p=oweals%2Fbusybox.git When displaying the size in 1kB blocks round up if an odd number of blocks --- diff --git a/coreutils/du.c b/coreutils/du.c index 7984d657a..df75a6953 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -77,7 +77,11 @@ static void print(long size, char *filename) bb_printf("%s\t%s\n", make_human_readable_str(size, 512, disp_hr), filename); #else - bb_printf("%ld\t%s\n", size >> disp_k, filename); + if (disp_k) { + size++; + size >>= 1; + } + bb_printf("%ld\t%s\n", size, filename); #endif }