From: Paul Eggert Date: Wed, 23 Jul 2025 15:31:38 +0000 (-0700) Subject: tail: fix SEEK_END typo X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=468f82115066dcd34f64148e165461359b2a0ee9;p=thirdparty%2Fcoreutils.git 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. --- 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 {