summaryrefslogtreecommitdiff
path: root/misc/colortail/patches/patch-aa
blob: d2b070229b989a74470d2e7e1f951a46ecda5488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-aa,v 1.2 2004/01/11 21:22:41 jschauma Exp $

--- TailFile.cc.orig	2004-01-11 16:19:14.000000000 -0500
+++ TailFile.cc	2004-01-11 16:20:33.000000000 -0500
@@ -375,7 +375,7 @@
    // 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 +417,9 @@
       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