diff options
| author | Ron Yorston <rmy@pobox.com> | 2013-08-27 16:10:53 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2013-08-27 16:10:53 +0100 |
| commit | 3fd34651ea72ea1c335d3170f234cb0517fd897f (patch) | |
| tree | 36e8fc40cffd464ffda4759020777dd3ca23ca31 /coreutils/split.c | |
| parent | e3ac39098326de084a805d0dd31db9666b734f20 (diff) | |
| parent | d6ae4fb446daedfe3073d67be655942e9fa7eb18 (diff) | |
| download | busybox-w32-3fd34651ea72ea1c335d3170f234cb0517fd897f.tar.gz busybox-w32-3fd34651ea72ea1c335d3170f234cb0517fd897f.tar.bz2 busybox-w32-3fd34651ea72ea1c335d3170f234cb0517fd897f.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils/split.c')
| -rw-r--r-- | coreutils/split.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/coreutils/split.c b/coreutils/split.c index 11e640442..1e1673efb 100644 --- a/coreutils/split.c +++ b/coreutils/split.c | |||
| @@ -23,17 +23,15 @@ | |||
| 23 | 23 | ||
| 24 | #include "libbb.h" | 24 | #include "libbb.h" |
| 25 | 25 | ||
| 26 | static const struct suffix_mult split_suffices[] = { | ||
| 27 | #if ENABLE_FEATURE_SPLIT_FANCY | 26 | #if ENABLE_FEATURE_SPLIT_FANCY |
| 27 | static const struct suffix_mult split_suffixes[] = { | ||
| 28 | { "b", 512 }, | 28 | { "b", 512 }, |
| 29 | #endif | ||
| 30 | { "k", 1024 }, | 29 | { "k", 1024 }, |
| 31 | { "m", 1024*1024 }, | 30 | { "m", 1024*1024 }, |
| 32 | #if ENABLE_FEATURE_SPLIT_FANCY | ||
| 33 | { "g", 1024*1024*1024 }, | 31 | { "g", 1024*1024*1024 }, |
| 34 | #endif | ||
| 35 | { "", 0 } | 32 | { "", 0 } |
| 36 | }; | 33 | }; |
| 34 | #endif | ||
| 37 | 35 | ||
| 38 | /* Increment the suffix part of the filename. | 36 | /* Increment the suffix part of the filename. |
| 39 | * Returns NULL if we are out of filenames. | 37 | * Returns NULL if we are out of filenames. |
| @@ -86,7 +84,10 @@ int split_main(int argc UNUSED_PARAM, char **argv) | |||
| 86 | if (opt & SPLIT_OPT_l) | 84 | if (opt & SPLIT_OPT_l) |
| 87 | cnt = XATOOFF(count_p); | 85 | cnt = XATOOFF(count_p); |
| 88 | if (opt & SPLIT_OPT_b) // FIXME: also needs XATOOFF | 86 | if (opt & SPLIT_OPT_b) // FIXME: also needs XATOOFF |
| 89 | cnt = xatoull_sfx(count_p, split_suffices); | 87 | cnt = xatoull_sfx(count_p, |
| 88 | IF_FEATURE_SPLIT_FANCY(split_suffixes) | ||
| 89 | IF_NOT_FEATURE_SPLIT_FANCY(km_suffixes) | ||
| 90 | ); | ||
| 90 | sfx = "x"; | 91 | sfx = "x"; |
| 91 | 92 | ||
| 92 | argv += optind; | 93 | argv += optind; |
