close directory handles properly when localized
Gurusamy Sarathy [Sun, 2 May 1999 19:24:41 +0000 (19:24 +0000)]
p4raw-id: //depot/perl@3298

sv.c

diff --git a/sv.c b/sv.c
index 218eff9..6068583 100644 (file)
--- 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));