From c66ebe4200af584b9101bcadc4a11509db8318a1 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Wed, 10 Mar 2004 09:58:51 +0000 Subject: [PATCH] When displaying the size in 1kB blocks round up if an odd number of blocks --- coreutils/du.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 } -- 2.25.1