diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-12-12 19:56:31 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-12-12 19:56:31 +0100 |
commit | e184a883567ee3fd735644416e4bd683f1894ac5 (patch) | |
tree | 7eae83fb609ecc41c44803e5969db5b1bb726f10 /libbb/xatonum.c | |
parent | 76de3257f7133a760c3d8908a99b850ea2d0f0b0 (diff) | |
download | busybox-w32-e184a883567ee3fd735644416e4bd683f1894ac5.tar.gz busybox-w32-e184a883567ee3fd735644416e4bd683f1894ac5.tar.bz2 busybox-w32-e184a883567ee3fd735644416e4bd683f1894ac5.zip |
df: implement -B n<suff> and -B <suff> formats of -B option
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/xatonum.c')
-rw-r--r-- | libbb/xatonum.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libbb/xatonum.c b/libbb/xatonum.c index 9dd5c3e7e..b63b7f54d 100644 --- a/libbb/xatonum.c +++ b/libbb/xatonum.c | |||
@@ -96,3 +96,22 @@ const struct suffix_mult cwbkMG_suffixes[] = { | |||
96 | /* coreutils also understands TPEZY suffixes for tera- and so on, with B suffix for decimal */ | 96 | /* coreutils also understands TPEZY suffixes for tera- and so on, with B suffix for decimal */ |
97 | { "", 0 } | 97 | { "", 0 } |
98 | }; | 98 | }; |
99 | |||
100 | const struct suffix_mult kmg_i_suffixes[] = { | ||
101 | { "KiB", 1024 }, | ||
102 | { "kiB", 1024 }, | ||
103 | { "K", 1024 }, | ||
104 | { "k", 1024 }, | ||
105 | { "MiB", 1048576 }, | ||
106 | { "miB", 1048576 }, | ||
107 | { "M", 1048576 }, | ||
108 | { "m", 1048576 }, | ||
109 | { "GiB", 1073741824 }, | ||
110 | { "giB", 1073741824 }, | ||
111 | { "G", 1073741824 }, | ||
112 | { "g", 1073741824 }, | ||
113 | { "KB", 1000 }, | ||
114 | { "MB", 1000000 }, | ||
115 | { "GB", 1000000000 }, | ||
116 | { "", 0 } | ||
117 | }; | ||