From: Gisle Aas <gisle@aas.no>
Date: 17 Jul 1998 14:58:25 +0200
Message-ID: <m3iukw63da.fsf@furu.g.aas.no>
Subject: Re: [PATCH _71] CRs et al
--
From: larry@wall.org (Larry Wall)
Date: Fri, 17 Jul 1998 09:32:35 -0700
Message-Id: <
199807171632.JAA12959@wall.org>
Subject: Re: [PATCH _71] CRs et al
p4raw-id: //depot/perl@1545
$x = 'now is the time
for all good men
to come to.
+
+
+!
+
';
$y = 'now is the time' . "\n" .
'for all good men' . "\n" .
-'to come to.' . "\n";
+'to come to.' . "\n\n\n!\n\n";
if ($x eq $y) {print "ok 1\n";} else {print "not ok 1\n";}
if ($z eq $y) {print "ok 2\n";} else {print "not ok 2\n";}
-if ($count == 3) {print "ok 3\n";} else {print "not ok 3\n";}
+if ($count == 7) {print "ok 3\n";} else {print "not ok 3\n";}
$_ = ($^O eq 'MSWin32') ? `type Comp.try` : `cat Comp.try`;
bufend = SvPVX(linestr) + SvCUR(linestr);
#ifdef TMP_CRLF_PATCH
if (bufend - linestart >= 2) {
- if (bufend[-2] == '\r' || bufend[-2] == '\n') {
+ if ((bufend[-2] == '\r' && bufend[-1] == '\n') ||
+ (bufend[-2] == '\n' && bufend[-1] == '\r'))
+ {
bufend[-2] = '\n';
bufend--;
SvCUR_set(linestr, bufend - SvPVX(linestr));
#ifdef TMP_CRLF_PATCH
if (to - SvPVX(sv) >= 2) {
- if (to[-2] == '\r' || to[-2] == '\n') {
+ if ((to[-2] == '\r' && to[-1] == '\n') ||
+ (to[-2] == '\n' && to[-1] == '\r'))
+ {
to[-2] = '\n';
to--;
SvCUR_set(sv, to - SvPVX(sv));