Commit ebbbc318d7 for perl
commit ebbbc318d7588d44d6708b6178bded2cc0d722ce
Author: GlobalTechStrategics <ian.t@globaltechstrategics.com>
Date: Fri Oct 2 20:58:28 2026 -0400
Add regression test for getc errno at EOF
diff --git a/t/op/readline.t b/t/op/readline.t
index e00773085c..1a15823126 100644
--- a/t/op/readline.t
+++ b/t/op/readline.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc('../lib');
}
-plan tests => 36;
+plan tests => 38;
# [perl #19566]: sv_gets writes directly to its argument via
# TARG. Test that we respect SvREADONLY.
@@ -91,6 +91,15 @@ fresh_perl_is('print readline', 'foo',
{ switches => ['-w'], stdin => 'foo', stderr => 1 },
'readline() defaults to *ARGV');
+{
+ open my $fh, '<', \q{} or die "open scalar handle failed: $!";
+ $! = 0;
+ my $ch = getc $fh;
+ is($ch, undef, 'getc returns undef at EOF');
+ is(0 + $!, 0, 'getc does not set errno at EOF');
+}
+
+
# [perl #72720] Test that sv_gets clears any variables that should be
# empty so if the read() aborts with EINTER, the TARG is actually
# cleared.