aboutsummaryrefslogtreecommitdiff
path: root/coreutils/du.c
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2001-06-13 08:02:45 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2001-06-13 08:02:45 +0000
commitf429baca868b7f62ffdeefbfce41abd677f97876 (patch)
tree64925420925deb361a2024b9b362e5c987334124 /coreutils/du.c
parent17822cd60aaf9333a9895494edcf03a0037de54c (diff)
downloadbusybox-f429baca868b7f62ffdeefbfce41abd677f97876.tar.gz
busybox-f429baca868b7f62ffdeefbfce41abd677f97876.tar.bz2
I reworked make_human_readable_str so it now has a sane interface,
and then fixed up df, du, and ls to use the new interface. I also fixed up some formatting issues in ls while I was in there. -Erik
Diffstat (limited to 'coreutils/du.c')
-rw-r--r--coreutils/du.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/coreutils/du.c b/coreutils/du.c
index fd19855e1..1966e3559 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -46,19 +46,8 @@ static Display *print;
static void print_normal(long size, char *filename)
{
- unsigned long base;
#ifdef BB_FEATURE_HUMAN_READABLE
- switch (disp_hr) {
- case MEGABYTE:
- base = KILOBYTE;
- break;
- case KILOBYTE:
- base = 1;
- break;
- default:
- base = 0;
- }
- printf("%s\t%s\n", make_human_readable_str(size, base), filename);
+ printf("%s\t%s\n", make_human_readable_str(size<<10, 1, disp_hr), filename);
#else
printf("%ld\t%s\n", size, filename);
#endif
@@ -259,7 +248,7 @@ int du_main(int argc, char **argv)
return status;
}
-/* $Id: du.c,v 1.48 2001/06/01 21:47:15 andersen Exp $ */
+/* $Id: du.c,v 1.49 2001/06/13 08:02:44 andersen Exp $ */
/*
Local Variables:
c-file-style: "linux"