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.)
-2006-12-21 Jim Meyering <jim@meyering.net>
-
- * Makefile.maint (patch-check): Fix shell quoting.
+2006-12-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * 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.)
2006-12-20 Jim Meyering <jim@meyering.net>
more file arguments. This was due to a double-free bug, introduced
in coreutils-5.3.0.
+ dd bs= operands now silently override any later ibs= and obs=
+ operands, as POSIX and tradition require.
+
A cross-partition "mv /etc/passwd ~" (by non-root) now prints
a reasonable diagnostic. Before, it would print this:
"mv: cannot remove `/etc/passwd': Not a directory".
@cindex block size
Set both input and output block sizes to @var{bytes}.
This makes @command{dd} read and write @var{bytes} per block,
-overriding any preceding @samp{ibs} and @samp{obs} settings.
+overriding any @samp{ibs} and @samp{obs} settings.
@item cbs=@var{bytes}
@opindex cbs
scanargs (int argc, char **argv)
{
int i;
+ size_t blocksize = 0;
for (i = optind; i < argc; i++)
{
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"))
{
}
}
+ 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. */
dd oflag=nolinks < $tmp_in > $tmp_out 2>&1 || fail=1
fi
+outbytes=`echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c`
+test "$outbytes" -eq 3 || fail=1
+
rm -f $tmp_in $tmp_in2 $tmp_sym $tmp_out
exit $fail