1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

tail: fix tailing /dev/zero

This fixes a bug where tail would run forever when tailing
/dev/zero.  This behavior matches GNU tail.
This commit is contained in:
Brian Vincent 2025-07-04 12:56:05 -07:00
parent 5f0077ecf8
commit 37611550d3
4 changed files with 33 additions and 23 deletions

View file

@ -4923,3 +4923,12 @@ fn test_failed_write_is_reported() {
.fails()
.stderr_is("tail: No space left on device\n");
}
#[test]
#[cfg(target_os = "linux")]
fn test_dev_zero() {
new_ucmd!()
.args(&["-c", "1", "/dev/zero"])
.succeeds()
.stdout_only("\0");
}