diff options
| author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-11-25 14:46:21 +0000 |
|---|---|---|
| committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-11-25 14:46:21 +0000 |
| commit | 90fbe2f4314127f0b80de8e0fb015dba0653e5fd (patch) | |
| tree | 546e4315d96ed4dc0610ef8c7c75ed4397b20f64 /coreutils | |
| parent | bb46b0d3a8f514681e03265bba58faff4bde89c1 (diff) | |
| download | busybox-w32-90fbe2f4314127f0b80de8e0fb015dba0653e5fd.tar.gz busybox-w32-90fbe2f4314127f0b80de8e0fb015dba0653e5fd.tar.bz2 busybox-w32-90fbe2f4314127f0b80de8e0fb015dba0653e5fd.zip | |
dd: support >2gb values for seek, skip, count
git-svn-id: svn://busybox.net/trunk/busybox@16665 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/dd.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 96ea32f06..01702a580 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
| @@ -44,6 +44,12 @@ static ssize_t full_write_or_warn(int fd, const void *buf, size_t len, | |||
| 44 | return n; | 44 | return n; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | #if ENABLE_LFS | ||
| 48 | #define XATOU_SFX xatoull_sfx | ||
| 49 | #else | ||
| 50 | #define XATOU_SFX xatoul_sfx | ||
| 51 | #endif | ||
| 52 | |||
| 47 | int dd_main(int argc, char **argv) | 53 | int dd_main(int argc, char **argv) |
| 48 | { | 54 | { |
| 49 | enum { | 55 | enum { |
| @@ -79,13 +85,13 @@ int dd_main(int argc, char **argv) | |||
| 79 | obs = xatoul_range_sfx(arg+4, 0, ((size_t)-1L)/2, dd_suffixes); | 85 | obs = xatoul_range_sfx(arg+4, 0, ((size_t)-1L)/2, dd_suffixes); |
| 80 | else if (!strncmp("bs=", arg, 3)) | 86 | else if (!strncmp("bs=", arg, 3)) |
| 81 | ibs = obs = xatoul_range_sfx(arg+3, 0, ((size_t)-1L)/2, dd_suffixes); | 87 | ibs = obs = xatoul_range_sfx(arg+3, 0, ((size_t)-1L)/2, dd_suffixes); |
| 82 | // FIXME: make them capable of eating LARGE numbers | 88 | /* These can be large: */ |
| 83 | else if (!strncmp("count=", arg, 6)) | 89 | else if (!strncmp("count=", arg, 6)) |
| 84 | count = xatoul_sfx(arg+6, dd_suffixes); | 90 | count = XATOU_SFX(arg+6, dd_suffixes); |
| 85 | else if (!strncmp("seek=", arg, 5)) | 91 | else if (!strncmp("seek=", arg, 5)) |
| 86 | seek = xatoul_sfx(arg+5, dd_suffixes); | 92 | seek = XATOU_SFX(arg+5, dd_suffixes); |
| 87 | else if (!strncmp("skip=", arg, 5)) | 93 | else if (!strncmp("skip=", arg, 5)) |
| 88 | skip = xatoul_sfx(arg+5, dd_suffixes); | 94 | skip = XATOU_SFX(arg+5, dd_suffixes); |
| 89 | 95 | ||
| 90 | else if (!strncmp("if=", arg, 3)) | 96 | else if (!strncmp("if=", arg, 3)) |
| 91 | infile = arg+3; | 97 | infile = arg+3; |
