Literally follow POSIX:

If the bs= expr operand is specified and no conversions other than sync,
noerror, or notrunc are requested, the data returned from each input
block shall be written as a separate output block.

In particular, when both bs=size and conv=sparce were specified, the
resulted file was fully filled, instead of sparce.

PR:	standards/177742
Submitted by:	Matthew Rezny <mrezny@hexaneinc.com>
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2013-04-23 16:08:24 +00:00
parent 5a6307cf42
commit 6784d416a5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249811

View file

@ -358,7 +358,7 @@ dd_in(void)
* than noerror, notrunc or sync are specified, the block
* is output without buffering as it is read.
*/
if (ddflags & C_BS) {
if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) {
out.dbcnt = in.dbcnt;
dd_out(1);
in.dbcnt = 0;