From: Gurusamy Sarathy Date: Thu, 30 Dec 1999 04:36:12 +0000 (+0000) Subject: CR-LF support broken for formats X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2dc4c65bf2b389aa184a8e8590cd1ee37ec953bc;p=p5sagit%2Fp5-mst-13.2.git CR-LF support broken for formats p4raw-id: //depot/perl@4738 --- diff --git a/toke.c b/toke.c index 18e95bd..452b20c 100644 --- a/toke.c +++ b/toke.c @@ -6894,6 +6894,14 @@ S_scan_formline(pTHX_ register char *s) needargs = TRUE; } sv_catpvn(stuff, s, eol-s); +#ifndef PERL_STRICT_CR + if (eol-s > 1 && eol[-2] == '\r' && eol[-1] == '\n') { + char *end = SvPVX(stuff) + SvCUR(stuff); + end[-2] = '\n'; + end[-1] = '\0'; + SvCUR(stuff)--; + } +#endif } s = eol; if (PL_rsfp) {