$OpenBSD: patch-TailFile_cc,v 1.4 2020/01/23 18:10:55 robert Exp $

Index: TailFile.cc
--- TailFile.cc.orig
+++ TailFile.cc
@@ -352,7 +352,10 @@ void TailFile::follow_print(int n, int verbose, char *
       int ch = fgetc(m_file);
 
       // add the character to the string
-      m_follow_buffer->put(ch);
+      if (ch == EOF)
+            clearerr(m_file);     // required by POSIX and ANSI
+      else
+            m_follow_buffer->put(ch);
       
       // check if return
       if (ch == '\n')
