Skip to content

Commit eb699a9

Browse files
haukextonycoz
authored andcommitted
First "eof" should return true
When no file has previously been opened, "eof" should return true. This behavior was broken by 32e6532 (see also [#60978]).
1 parent b4e880f commit eb699a9

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pp_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ PP(pp_eof)
21212121
}
21222122

21232123
if (!gv)
2124-
RETPUSHNO;
2124+
RETPUSHYES;
21252125

21262126
if ((io = GvIO(gv)) && (mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar))) {
21272127
return tied_method1(SV_CONST(EOF), SP, MUTABLE_SV(io), mg, newSVuv(which));

t/io/tell.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ seek *$fh,0,0;
189189
is(tell, 0, "argless tell after seek *\$coercible...");
190190

191191
{
192-
local $TODO = "not fixed yet";
193192
# [perl #133721]
194193
fresh_perl_is(<<'EOI', 'ok', {}, 'eof with no ${^LAST_FH}');
195194
print "ok" if eof;

0 commit comments

Comments
 (0)