Permalink
Browse files

C: save IO for *STDIN also

mainly the utf8 layer (not yet working)
add testc.sh 210
  • Loading branch information...
1 parent 564a4b8 commit 2a679bf84b7fe80d7eeb4e8bae3832bbfbf16574 @rurban committed Feb 17, 2014
Showing with 13 additions and 3 deletions.
  1. +3 −3 lib/B/C.pm
  2. +10 −0 t/testc.sh
View
6 lib/B/C.pm
@@ -3641,7 +3641,7 @@ sub B::GV::save {
$is_coresym++;
}
}
- if ($fullname =~ /^main::std(in|out|err)$/) {
+ if ($fullname =~ /^main::std(in|out|err)$/) { # same as uppercase above
$init->add(qq[$sym = gv_fetchpv($name, $notqual, SVt_PVGV);]);
$init->add( sprintf( "SvREFCNT($sym) = %u;", $gv->REFCNT ) );
return $sym;
@@ -3760,7 +3760,7 @@ sub B::GV::save {
elsif ( $fullname eq 'main::ARGV' ) {
$savefields = Save_HV | Save_SV | Save_CV | Save_FORM | Save_IO;
}
- elsif ( $fullname =~ /^main::STD(OUT|ERR)$/ ) {
+ elsif ( $fullname =~ /^main::STD(IN|OUT|ERR)$/ ) {
$savefields = Save_FORM | Save_IO;
}
$savefields &= ~$filter if ($filter and $filter !~ / :pad/
@@ -3993,7 +3993,7 @@ sub B::GV::save {
$init->add("");
}
}
- # Shouldn't need to do save_magic since gv_fetchpv handles that. Esp. < not
+ # Shouldn't need to do save_magic since gv_fetchpv handles that. Esp. < and IO not
# $gv->save_magic($fullname) if $PERL510;
warn "GV::save *$fullname done\n" if $debug{gv};
return $sym;
View
10 t/testc.sh
@@ -907,6 +907,16 @@ if [[ `$PERL -e'print (($] < 5.014)?0:1)'` -gt 0 ]]; then
else
result[208]=' MyKooh OurKooh'
fi
+tests[210]='
+$a = 123;
+package xyz;
+sub xsub {bless [];}
+$x1 = 1; $x2 = 2;
+$s = join(":", sort(keys %xyz::));
+package abc;
+my $foo;
+print q(ok) if $xyz::s eq "s:x1:x2:xsub";'
+result[210]='ok'
tests[212]='$blurfl = 123;
{
package abc;

0 comments on commit 2a679bf

Please sign in to comment.