diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-11-08 18:31:09 +0000 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-11-08 18:31:09 +0000 |
commit | 8d06e08c4f7bbcd6ede7e25da37c216be42278e5 (patch) | |
tree | f92680fdb8074bd56b656e9237f5fffb9bd45723 /ext | |
parent | 2376d97dd5675c65de55efc384814387b6c9a63f (diff) | |
download | perl-8d06e08c4f7bbcd6ede7e25da37c216be42278e5.tar.gz |
Make sure PerlIO::via doesn't leave its old GV's hanging
in the stash they were created in. Steal the idea from
IO::File to just delete the stash entry after creating
the GV.
This fixes perl #59268.
p4raw-id: //depot/perl@34779
Diffstat (limited to 'ext')
-rw-r--r-- | ext/PerlIO/via/via.pm | 2 | ||||
-rw-r--r-- | ext/PerlIO/via/via.xs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/PerlIO/via/via.pm b/ext/PerlIO/via/via.pm index f7ab7490b1..6ff804e544 100644 --- a/ext/PerlIO/via/via.pm +++ b/ext/PerlIO/via/via.pm @@ -1,5 +1,5 @@ package PerlIO::via; -our $VERSION = '0.06'; +our $VERSION = '0.07'; use XSLoader (); XSLoader::load 'PerlIO::via'; 1; diff --git a/ext/PerlIO/via/via.xs b/ext/PerlIO/via/via.xs index 5e6ddd3a9d..e50052ca51 100644 --- a/ext/PerlIO/via/via.xs +++ b/ext/PerlIO/via/via.xs @@ -91,6 +91,10 @@ PerlIOVia_method(pTHX_ PerlIO * f, const char *method, CV ** save, int flags, GvIOp(gv) = newIO(); s->fh = newRV((SV *) gv); s->io = GvIOp(gv); + if (gv) { + /* shamelessly stolen from IO::File's new_tmpfile() */ + hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD); + } } IoIFP(s->io) = PerlIONext(f); IoOFP(s->io) = PerlIONext(f); |