8b91212
From eb699a9c8fb7ddfcafc714f1eba1bbc395dc3675 Mon Sep 17 00:00:00 2001
8b91212
From: Hauke D <haukex@zero-g.net>
8b91212
Date: Wed, 12 Dec 2018 22:26:26 +0100
8b91212
Subject: [PATCH] First "eof" should return true
8b91212
MIME-Version: 1.0
8b91212
Content-Type: text/plain; charset=UTF-8
8b91212
Content-Transfer-Encoding: 8bit
8b91212
8b91212
When no file has previously been opened, "eof" should return true. This
8b91212
behavior was broken by 32e653230c7ccc (see also [#60978]).
8b91212
8b91212
Signed-off-by: Petr Písař <ppisar@redhat.com>
8b91212
---
8b91212
 pp_sys.c    | 2 +-
8b91212
 t/io/tell.t | 1 -
8b91212
 2 files changed, 1 insertion(+), 2 deletions(-)
8b91212
8b91212
diff --git a/pp_sys.c b/pp_sys.c
8b91212
index 5dc20b14f0..e28e8906f1 100644
8b91212
--- a/pp_sys.c
8b91212
+++ b/pp_sys.c
8b91212
@@ -2121,7 +2121,7 @@ PP(pp_eof)
8b91212
     }
8b91212
 
8b91212
     if (!gv)
8b91212
-	RETPUSHNO;
8b91212
+	RETPUSHYES;
8b91212
 
8b91212
     if ((io = GvIO(gv)) && (mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar))) {
8b91212
 	return tied_method1(SV_CONST(EOF), SP, MUTABLE_SV(io), mg, newSVuv(which));
8b91212
diff --git a/t/io/tell.t b/t/io/tell.t
8b91212
index 30adafbc01..ba106f0cc7 100644
8b91212
--- a/t/io/tell.t
8b91212
+++ b/t/io/tell.t
8b91212
@@ -189,7 +189,6 @@ seek *$fh,0,0;
8b91212
 is(tell, 0, "argless tell after seek *\$coercible...");
8b91212
 
8b91212
 {
8b91212
-    local $TODO = "not fixed yet";
8b91212
     # [perl #133721]
8b91212
     fresh_perl_is(<<'EOI', 'ok', {}, 'eof with no ${^LAST_FH}');
8b91212
 print "ok" if eof;
8b91212
-- 
8b91212
2.17.2
8b91212