From f96ceb3029343f4ab81912333e3ee53a76f33ff5 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 23 Apr 2013 16:08:24 +0000 Subject: 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 MFC after: 2 weeks --- bin/dd/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/dd') diff --git a/bin/dd/dd.c b/bin/dd/dd.c index 01b66fc..9d0f9b1 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -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; -- cgit v1.1