--- src/tail.c.orig Sun Sep 30 21:26:52 2001 +++ src/tail.c Tue Nov 13 18:34:06 2001 @@ -1088,9 +1088,9 @@ file_lines. file_lines shouldn't presume that the input file pointer is initially positioned to beginning of file. */ if (S_ISREG (stats.st_mode) - && lseek (fd, (off_t) 0, SEEK_CUR) == (off_t) 0) + && lseek (fd, (off_t) 0, SEEK_CUR) == (off_t) 0 + && (length = lseek (fd, (off_t) 0, SEEK_END)) >= 0) { - length = lseek (fd, (off_t) 0, SEEK_END); if (length != 0 && file_lines (pretty_filename, fd, n_lines, length)) return 1; }