From f429baca868b7f62ffdeefbfce41abd677f97876 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 13 Jun 2001 08:02:45 +0000 Subject: 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 --- du.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'du.c') diff --git a/du.c b/du.c index fd19855e1..1966e3559 100644 --- a/du.c +++ b/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" -- cgit v1.2.3-55-g6feb