aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-03-10 09:58:51 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-03-10 09:58:51 +0000
commitd80a07e525f699e9eb51ca2fbacfeeb406d425c6 (patch)
tree8fe66fd701ef921e9f2411c42645288d48585fa6
parent3a8a7393f08be8e93a4b5325bb6ccd59d0411750 (diff)
downloadbusybox-w32-d80a07e525f699e9eb51ca2fbacfeeb406d425c6.tar.gz
busybox-w32-d80a07e525f699e9eb51ca2fbacfeeb406d425c6.tar.bz2
busybox-w32-d80a07e525f699e9eb51ca2fbacfeeb406d425c6.zip
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
-rw-r--r--coreutils/du.c6
1 files changed, 5 insertions, 1 deletions
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)
77 bb_printf("%s\t%s\n", make_human_readable_str(size, 512, disp_hr), 77 bb_printf("%s\t%s\n", make_human_readable_str(size, 512, disp_hr),
78 filename); 78 filename);
79#else 79#else
80 bb_printf("%ld\t%s\n", size >> disp_k, filename); 80 if (disp_k) {
81 size++;
82 size >>= 1;
83 }
84 bb_printf("%ld\t%s\n", size, filename);
81#endif 85#endif
82} 86}
83 87