]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tail: fix SEEK_END typo
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Jul 2025 15:31:38 +0000 (08:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Aug 2025 02:48:04 +0000 (19:48 -0700)
* src/tail.c (tail_lines): Fix embarrassing SEEK_END typo.
Luckily this matters only in never-used (though valid) invocations.

NEWS
src/tail.c

diff --git a/NEWS b/NEWS
index a9132bbcfd04c58fe463dec6aabce3ba7ada6604..615d7cb82434cf0e63b3a6672922d19d5f8ba0ba 100644 (file)
--- 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.
index caf67a0500c30d6335bbdf045d0664eb08359fa9..255f581fa14c3745a6352707e8727d6535d9a862 100644 (file)
@@ -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
         {