diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-12-22 10:09:37 +0100 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-12-22 10:09:37 +0100 |
commit | f24ff8f42b45f868876bde7d21046c01188d42a4 (patch) | |
tree | b0a031d5b386b224b5bc6ad7c52d0b82acb05f29 /src | |
parent | 699188aa87648cc487ee7bcdaeebfcbbb182e356 (diff) | |
download | coreutils-f24ff8f42b45f868876bde7d21046c01188d42a4.tar.xz |
* NEWS: dd bs= operands now silently override later ibs= and obs=,
as POSIX requires.
* src/dd.c (scanargs): Implement it.
* tests/dd/misc (outbytes): Test it.
* doc/coreutils.texi (dd invocation): Specify that bs=N
overrides later ibs and obs, undoing part of the
previous change. (The behavior was wrong.)
Diffstat (limited to 'src')
-rw-r--r-- | src/dd.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -873,6 +873,7 @@ static void scanargs (int argc, char **argv) { int i; + size_t blocksize = 0; for (i = optind; i < argc; i++) { @@ -923,7 +924,7 @@ scanargs (int argc, char **argv) else if (STREQ (name, "bs")) { invalid |= ! (0 < n && n <= MAX_BLOCKSIZE (INPUT_BLOCK_SLOP)); - output_blocksize = input_blocksize = n; + blocksize = n; } else if (STREQ (name, "cbs")) { @@ -948,6 +949,9 @@ scanargs (int argc, char **argv) } } + if (blocksize) + input_blocksize = output_blocksize = blocksize; + /* If bs= was given, both `input_blocksize' and `output_blocksize' will have been set to positive values. If either has not been set, bs= was not given, so make sure two buffers are used. */ |