From 468f82115066dcd34f64148e165461359b2a0ee9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 23 Jul 2025 08:31:38 -0700 Subject: [PATCH] tail: fix SEEK_END typo * src/tail.c (tail_lines): Fix embarrassing SEEK_END typo. Luckily this matters only in never-used (though valid) invocations. --- NEWS | 4 ++++ src/tail.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a9132bbcfd..615d7cb824 100644 --- a/NEWS +++ b/NEWS @@ -51,6 +51,10 @@ GNU coreutils NEWS -*- outline -*- stdbuf now works on AIX. Previously it would have been ineffective. [bug introduced with the stdbuf program in coreutils-7.5] + 'tail -f -n +NUM' no longer mishandles NUM values >= UINTMAX_MAX + when the input is seekable. + [bug introduced in coreutils-9.6] + tty now exits with status 4 with a special diagnostic if ttyname fails even though standard input is a tty. Formerly it quietly pretended that standard input was not a tty. diff --git a/src/tail.c b/src/tail.c index caf67a0500..255f581fa1 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1933,7 +1933,7 @@ tail_lines (char const *pretty_filename, int fd, uintmax_t n_lines, { /* If skipping all input use lseek if possible, for speed. */ off_t pos; - if (n_lines == UINTMAX_MAX && 0 <= (pos = lseek (fd, SEEK_END, 0))) + if (n_lines == UINTMAX_MAX && 0 <= (pos = lseek (fd, 0, SEEK_END))) *read_pos = pos; else { -- 2.47.2