$NetBSD: patch-aa,v 1.3 2011/11/26 17:16:53 joerg Exp $

--- TailFile.cc.orig	1999-08-04 23:09:38.000000000 +0000
+++ TailFile.cc
@@ -17,7 +17,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include <iostream.h>
+#include <iostream>
 #include <string.h>
 #include <stdio.h>
 #include <sys/stat.h>
@@ -25,6 +25,8 @@
 
 #include "TailFile.h"
 
+using namespace std;
+
 TailFile::TailFile()
 {
    m_filename = NULL;
@@ -375,7 +377,7 @@ void TailFile::follow_print(int n, int v
    // check if there isn't a follow buffer
    if (m_follow_buffer == NULL)
    {
-      m_follow_buffer = new ostrstream();
+      m_follow_buffer = new std::ostrstream();
    }
 
    // make buffer
@@ -417,6 +419,9 @@ void TailFile::follow_print(int n, int v
       int ch = fgetc(m_file);
 
       // add the character to the string
+      if (ch == EOF)
+          clearerr(m_file);     // required by POSIX and ANSI
+      else
       m_follow_buffer->put(ch);
       
       // check if return
