From: Gurusamy Sarathy Date: Sun, 2 May 1999 19:39:55 +0000 (+0000) Subject: add test case for change#3298 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1236053a2c722e2b9e93af4bb14c92036416d727;p=p5sagit%2Fp5-mst-13.2.git add test case for change#3298 p4raw-link: @3298 on //depot/perl: 93578b34124e8a3b976cd7f68c60e871e698c9d5 p4raw-id: //depot/perl@3299 --- diff --git a/sv.c b/sv.c index 6068583..5772954 100644 --- a/sv.c +++ b/sv.c @@ -2737,9 +2737,9 @@ sv_clear(register SV *sv) { io_close((IO*)sv); } - if (IoDIRP((IO*)sv)) { - PerlDir_close(IoDIRP((IO*)sv)); - IoDIRP((IO*)sv) = 0; + if (IoDIRP(sv)) { + PerlDir_close(IoDIRP(sv)); + IoDIRP(sv) = 0; } Safefree(IoTOP_NAME(sv)); Safefree(IoFMT_NAME(sv)); diff --git a/t/op/readdir.t b/t/op/readdir.t index ca19ebc..aea9768 100755 --- a/t/op/readdir.t +++ b/t/op/readdir.t @@ -5,6 +5,12 @@ if ($@) { print "1..0\n"; exit; } print "1..3\n"; +for $i (1..2000) { + local *OP; + opendir(OP, "op") or die "can't opendir: $!"; + # should auto-closedir() here +} + if (opendir(OP, "op")) { print "ok 1\n"; } else { print "not ok 1\n"; } @D = grep(/^[^\.].*\.t$/i, readdir(OP)); closedir(OP);