[project @ 1998-08-14 12:42:01 by sof]
[ghc-hetmet.git] / ghc / lib / std / cbits / fileEOF.lc
index cdd3eb2..3d09e38 100644 (file)
@@ -9,10 +9,15 @@
 #include "stgio.h"
 
 StgInt
-fileEOF(fp)
-StgForeignObj fp;
+fileEOF(ptr)
+StgForeignObj ptr;
 {
-    if (fileLookAhead(fp) != EOF)
+    IOFileObject* fo = (IOFileObject*)ptr;
+
+    if ( FILEOBJ_IS_EOF(fo) )
+       return 1;
+
+    if (fileLookAhead(ptr) != EOF)
        return 0;
     else if (ghc_errtype == ERR_EOF)
        return 1;