diff options
author | Steve Hay <SteveHay@planit.com> | 2008-06-17 16:50:57 +0000 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2008-06-17 16:50:57 +0000 |
commit | 799361c3c96b8b5eb1dd262f6945e07624ac881f (patch) | |
tree | 9171647888dc196826bde14d4565e725167acfec /toke.c | |
parent | cba5fa5d0a628e83dc21e7421428994b2d09c88e (diff) | |
download | perl-799361c3c96b8b5eb1dd262f6945e07624ac881f.tar.gz |
Make sure parser's filehandle is closed when finished
(It was mistakenly left open if there was no old_parser, which caused
t/comp/require.t to leave behind a 'bleah.pm' (from the test for
#49472) on Win32, where the deletion of an open file fails.)
p4raw-id: //depot/perl@34071
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -761,8 +761,8 @@ Perl_parser_free(pTHX_ const yy_parser *parser) if (parser->rsfp == PerlIO_stdin()) PerlIO_clearerr(parser->rsfp); - else if (parser->rsfp && parser->old_parser - && parser->rsfp != parser->old_parser->rsfp) + else if (parser->rsfp && (!parser->old_parser || + (parser->old_parser && parser->rsfp != parser->old_parser->rsfp))) PerlIO_close(parser->rsfp); SvREFCNT_dec(parser->rsfp_filters); |