(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
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);