diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2008-03-31 08:37:36 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-03-31 08:37:58 +0200 |
commit | e373bb193357481573913ccf28dc14675f172d5a (patch) | |
tree | 56d968f7d410e20a1afb4811d71e3bb631fe8f81 /tests/dd/misc | |
parent | 72e962c97e30fa8a9146d90fa36098137ce0ee0f (diff) | |
download | coreutils-e373bb193357481573913ccf28dc14675f172d5a.tar.xz |
dd bug fix: accept e.g., if=/dev/stdin and of=/dev/stdout
* lib/fd-reopen.c: Work even if FILE is "/dev/stdin".
Problem reported by Geoffrey Lee in <http://bugs.debian.org/290727>.
* tests/dd/misc: Check for this bug.
Diffstat (limited to 'tests/dd/misc')
-rwxr-xr-x | tests/dd/misc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/dd/misc b/tests/dd/misc index 917258236..2b54cfb36 100755 --- a/tests/dd/misc +++ b/tests/dd/misc @@ -46,6 +46,13 @@ if dd oflag=append if=$tmp_in of=$tmp_out 2> /dev/null; then compare $tmp_in $tmp_out || fail=1 fi +case $(cat /dev/stdin <$tmp_in 2>/dev/null) in +(data) + rm -f $tmp_out + dd if=/dev/stdin of=$tmp_out <$tmp_in || fail=1 + compare $tmp_in $tmp_out || fail=1 +esac + if dd iflag=nofollow if=$tmp_in count=0 2> /dev/null; then dd iflag=nofollow if=$tmp_sym count=0 2> /dev/null && fail=1 fi |