summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-02 19:24:41 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-02 19:24:41 +0000
commit93578b34124e8a3b976cd7f68c60e871e698c9d5 (patch)
treed81e50bbb91e1181b2b03314f1303e8a622cd3db /sv.c
parent7d4fbd985f152f93fb488c6a48bdc3521292ba39 (diff)
downloadperl-93578b34124e8a3b976cd7f68c60e871e698c9d5.tar.gz
close directory handles properly when localized
p4raw-id: //depot/perl@3298
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 218eff9aea..6068583d71 100644
--- a/sv.c
+++ b/sv.c
@@ -2734,7 +2734,13 @@ sv_clear(register SV *sv)
IoIFP(sv) != PerlIO_stdin() &&
IoIFP(sv) != PerlIO_stdout() &&
IoIFP(sv) != PerlIO_stderr())
+ {
io_close((IO*)sv);
+ }
+ if (IoDIRP((IO*)sv)) {
+ PerlDir_close(IoDIRP((IO*)sv));
+ IoDIRP((IO*)sv) = 0;
+ }
Safefree(IoTOP_NAME(sv));
Safefree(IoFMT_NAME(sv));
Safefree(IoBOTTOM_NAME(sv));