summaryrefslogtreecommitdiffstats
path: root/bin/dd
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-04-23 16:08:24 +0000
committerkib <kib@FreeBSD.org>2013-04-23 16:08:24 +0000
commitf96ceb3029343f4ab81912333e3ee53a76f33ff5 (patch)
tree4330c7945a4515fcf1e885c904d2052fd1dda811 /bin/dd
parented68431e9eb5f5d79436afe779c4564cc625c69e (diff)
downloadFreeBSD-src-f96ceb3029343f4ab81912333e3ee53a76f33ff5.zip
FreeBSD-src-f96ceb3029343f4ab81912333e3ee53a76f33ff5.tar.gz
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
Diffstat (limited to 'bin/dd')
-rw-r--r--bin/dd/dd.c2
1 files changed, 1 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud