From d80a07e525f699e9eb51ca2fbacfeeb406d425c6 Mon Sep 17 00:00:00 2001 From: bug1 Date: Wed, 10 Mar 2004 09:58:51 +0000 Subject: When displaying the size in 1kB blocks round up if an odd number of blocks git-svn-id: svn://busybox.net/trunk/busybox@8610 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- 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 } -- cgit v1.2.3-55-g6feb