PP_backtick's temp altering of PL_rs didn't restore after
an exception
p4raw-id: //depot/perl@23898
;
}
else if (gimme == G_SCALAR) {
- SV *oldrs = PL_rs;
+ ENTER;
+ SAVESPTR(PL_rs);
PL_rs = &PL_sv_undef;
sv_setpv(TARG, ""); /* note that this preserves previous buffer */
while (sv_gets(TARG, fp, SvCUR(TARG)) != Nullch)
/*SUPPRESS 530*/
;
- PL_rs = oldrs;
+ LEAVE;
XPUSHs(TARG);
SvTAINTED_on(TARG);
}
}
}
-plan tests => 4;
+plan tests => 5;
my $Perl = which_perl();
my $start_time = time;
if $^O eq 'VMS' || $^O eq'MacOS' || $^O eq 'dos';
ok( abs($diff - 3) <= 1, " right time (waited $diff secs for 3-sec alarm)" );
}
+
+
+{
+ local $SIG{"ALRM"} = sub { die };
+ eval { alarm(1); my $x = qx($Perl -e sleep 3) };
+ chomp (my $foo = "foo\n");
+ ok($foo eq "foo", '[perl #33928] chomp() fails after alarm(), `sleep`');
+}