diff --git a/NEWS b/NEWS index 41205fa88..2b8f984ba 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,10 @@ GNU coreutils NEWS -*- outline -*- 'pr --length=1 --double-space' no longer enters an infinite loop. [This bug was present in "the beginning".] + tac now handles short reads on its input. Previously it may have exited + erroneously, especially with large input files with no separators. + [This bug was present in "the beginning".] + 'uptime' no longer incorrectly prints "0 users" on OpenBSD. [bug introduced in coreutils-9.2] diff --git a/src/tac.c b/src/tac.c index 285f99a74..4c3655895 100644 --- a/src/tac.c +++ b/src/tac.c @@ -44,6 +44,7 @@ tac -r -s '.\| #include #include "filenamecat.h" +#include "full-read.h" #include "safe-read.h" #include "temp-stream.h" #include "xbinary-io.h" @@ -336,7 +337,7 @@ tac_seekable (int input_fd, char const *file, off_t file_pos) else match_start = past_end; - if (safe_read (input_fd, G_buffer, read_size) != read_size) + if (full_read (input_fd, G_buffer, read_size) != read_size) { error (0, errno, _("%s: read error"), quotef (file)); return false;