1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-16 02:01:05 +00:00
uutils-coreutils/src
jfinkels 86b012d3be
dd: handle stdout redirected to seekable file (#3880)
* dd: move argument parsing outside of Input, Output

Move the argument parsing code out of the `Input::new()` and
`Output::new()` functions and into the calling code. This allows the
calling code to make decisions about how to instantiate the `Input`
and `Output` objects if necessary.

* dd: handle stdout redirected to seekable file

Fix a bug in `dd` where null bytes would be unintentionally written if
stdout were redirected to a seekable file. For example, before this
commit, if `dd` were invoked from the command-line as

    dd if=infile bs=1 count=10 seek=5 > /dev/sda1

then five zeros would be written to `/dev/sda1` before copying ten
bytes of `infile` to `/dev/sda1`. After this commit, `dd` will
correctly seek five bytes forward in `/dev/sda1` before copying the
ten bytes of `infile`.

Fixes #3542.
2022-09-18 21:53:01 +02:00
..
bin Fix completion with a clap update 2022-08-17 13:13:27 +03:00
uu dd: handle stdout redirected to seekable file (#3880) 2022-09-18 21:53:01 +02:00
uucore change remaining usage codes of 2 to 1 for GNU compat 2022-09-10 20:24:24 +02:00
uucore_procs Clippy fixes in multiple crates 2022-08-23 18:30:43 -04:00