dd: pad partial record with spaces in some cases #3156
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If
conv=block,sync
command-line arguments are given and there is atleast one partial record read from the input (for example, if the
length of the input is not divisible by the value of the
ibs
argument), then output an extra block of
cbs
spaces.For example, no extra spaces are printed in this example because the
input is of length 10, a multiple of
ibs
:But in this example, 5 extra spaces are printed because the length of
the input is not a multiple of
ibs
:The number of spaces printed is the size of the conversion block,
given by
cbs
.(I came to this understanding of the program logic by reverse-engineering the output of GNU
dd
, so I may be wrong about it.)