1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-21 20:51:11 +00:00
uutils-coreutils/tests
Jeffrey Finkelstein 9cb6b4a3c0 dd: open stdin from file descriptor when possible
Open stdin using its file descriptor so that a `dd skip=N` command in
a subshell does not consume all bytes from stdin.

For example, before this commit, multiple instances of `dd` reading
from stdin and appearing in a single command line would incorrectly
result in an empty stdin for each instance of `dd` after the first:

    $ printf "abcdef\n" | (dd bs=1 skip=3 count=0 && dd)  2> /dev/null
    # incorrectly results in no output

After this commit, the `dd skip=3` process reads three bytes from the
file descriptor referring to stdin without draining the remaining
three bytes when it terminates:

    $ printf "abcdef\n" | (dd bs=1 skip=3 count=0 && dd)  2> /dev/null
    def
2023-03-11 20:56:37 +00:00
..
benches/factor all: remove explicit imports of TryFrom and TryInto 2022-04-05 10:39:31 +02:00
by-util dd: open stdin from file descriptor when possible 2023-03-11 20:56:37 +00:00
common Merge branch 'main' into cp-pathbuf 2023-03-05 16:22:21 +01:00
fixtures comm: implement --zero-terminated 2023-03-01 16:59:51 +01:00
test_util_name.rs chore: run cargo +nightly clippy --fix 2022-11-16 11:09:44 +02:00
tests.rs tests: do not generate module structure in build.rs 2022-10-05 13:30:22 +02:00