When displaying the size in 1kB blocks round up if an odd number of
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 10 Mar 2004 09:58:51 +0000 (09:58 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 10 Mar 2004 09:58:51 +0000 (09:58 -0000)
blocks

coreutils/du.c

index 7984d657a227541ca3e034a8c3cbf24e4d1c6781..df75a6953bb6ba6a85e422460a72a944e4c0d63f 100644 (file)
@@ -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
 }