diff options
-rw-r--r-- | coreutils/df.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/coreutils/df.c b/coreutils/df.c index e8d4bc8f2..9f8b3a71e 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -99,15 +99,16 @@ int df_main(int argc UNUSED_PARAM, char **argv) struct mntent *mount_entry; struct statvfs s; enum { - OPT_KILO = (1 << 0), - OPT_POSIX = (1 << 1), - OPT_FSTYPE = (1 << 2), - OPT_t = (1 << 3), - OPT_ALL = (1 << 4) * ENABLE_FEATURE_DF_FANCY, - OPT_INODE = (1 << 5) * ENABLE_FEATURE_DF_FANCY, - OPT_BSIZE = (1 << 6) * ENABLE_FEATURE_DF_FANCY, - OPT_HUMAN = (1 << (4 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, - OPT_MEGA = (1 << (5 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, + OPT_KILO = (1 << 0), + OPT_POSIX = (1 << 1), + OPT_FSTYPE = (1 << 2), + OPT_t = (1 << 3), + OPT_ALL = (1 << 4) * ENABLE_FEATURE_DF_FANCY, + OPT_INODE = (1 << 5) * ENABLE_FEATURE_DF_FANCY, + OPT_BSIZE = (1 << 6) * ENABLE_FEATURE_DF_FANCY, + OPT_HUMAN = (1 << (4 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, + OPT_HUMANDEC = (1 << (5 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, + OPT_MEGA = (1 << (6 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE, }; const char *disp_units_hdr = NULL; char *chp, *opt_t; @@ -124,7 +125,7 @@ int df_main(int argc UNUSED_PARAM, char **argv) opt = getopt32(argv, "^" "kPTt:" IF_FEATURE_DF_FANCY("aiB:") - IF_FEATURE_HUMAN_READABLE("hm") + IF_FEATURE_HUMAN_READABLE("hHm") "\0" #if ENABLE_FEATURE_HUMAN_READABLE && ENABLE_FEATURE_DF_FANCY "k-mB:m-Bk:B-km" @@ -151,8 +152,11 @@ int df_main(int argc UNUSED_PARAM, char **argv) got_it: ; } - if (opt & OPT_HUMAN) { + if (opt & (OPT_HUMAN|OPT_HUMANDEC)) { df_disp_hr = 0; +//TODO: need to add support in make_human_readable_str() for "decimal human readable" + //if (opt & OPT_HUMANDEC) + // df_disp_hr--; disp_units_hdr = " Size"; } if (opt & OPT_INODE) |