summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-30 04:36:12 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-30 04:36:12 +0000
commit2dc4c65bf2b389aa184a8e8590cd1ee37ec953bc (patch)
treeecd94abb7044889439b817566d970685563bb4a6 /toke.c
parentf2abf2f9e52d9e6e8083b87a5890e0f10f018510 (diff)
downloadperl-2dc4c65bf2b389aa184a8e8590cd1ee37ec953bc.tar.gz
CR-LF support broken for formats
p4raw-id: //depot/perl@4738
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 18e95bd435..452b20c1a6 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) {