aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xatonum.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libbb/xatonum.c b/libbb/xatonum.c
index 6f4e023bb..19b54fb0c 100644
--- a/libbb/xatonum.c
+++ b/libbb/xatonum.c
@@ -75,3 +75,22 @@ const struct suffix_mult bkm_suffixes[] = {
{ "m", 1024*1024 },
{ "", 0 }
};
+
+const struct suffix_mult cwbkMG_suffixes[] = {
+ { "c", 1 },
+ { "w", 2 },
+ { "b", 512 },
+ { "kB", 1000 },
+ { "kD", 1000 },
+ { "k", 1024 },
+ { "K", 1024 }, /* compat with coreutils dd (it also accepts KB and KD, TODO?) */
+ { "MB", 1000000 },
+ { "MD", 1000000 },
+ { "M", 1024*1024 },
+ { "GB", 1000000000 },
+ { "GD", 1000000000 },
+ { "G", 1024*1024*1024 },
+ /* "D" suffix for decimal is not in coreutils manpage, looks like it's deprecated */
+ /* coreutils also understands TPEZY suffixes for tera- and so on, with B suffix for decimal */
+ { "", 0 }
+};