diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-30 19:35:07 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-30 19:35:07 +0000 |
commit | 53129d29569a85455957955379fd49abdaaf8185 (patch) | |
tree | e5ec616a792a9b6e0a815dfcd1f645948d9b4aff /toke.c | |
parent | c39cd00800303e8967294e98aa4c427a1872a251 (diff) | |
download | perl-53129d29569a85455957955379fd49abdaaf8185.tar.gz |
leave DATA open in binmode if __END__ line doesn't have CRLF
p4raw-id: //depot/perl@4740
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3808,8 +3808,10 @@ Perl_yylex(pTHX) IoTYPE(GvIOp(gv)) = '<'; #if defined(WIN32) && !defined(PERL_TEXTMODE_SCRIPTS) /* if the script was opened in binmode, we need to revert - * it to text mode for compatibility. + * it to text mode for compatibility; but only iff it has CRs * XXX this is a questionable hack at best. */ + if (PL_bufend-PL_bufptr > 2 + && PL_bufend[-1] == '\n' && PL_bufend[-2] == '\r') { Off_t loc = 0; if (IoTYPE(GvIOp(gv)) == '<') { |