summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-03-26 15:09:52 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-03-26 15:09:52 +0000
commit23b3c6afbc19427431935e4c7758d215f61faf41 (patch)
tree0f86d5ce0c187e8169ab597592bad610449644f1 /perlio.c
parent621fdfbe1ddec6f73d55f0cf5d3c8327a9d4bde4 (diff)
downloadperl-23b3c6afbc19427431935e4c7758d215f61faf41.tar.gz
Fix [ID 20020326.001] - cr/lf spanning buffer boundary
p4raw-id: //depot/perlio@15520
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/perlio.c b/perlio.c
index fde7ea9260..12536961fb 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3492,8 +3492,8 @@ PerlIOCrlf_get_cnt(pTHX_ PerlIO *f)
PerlIO_get_base(f);
if (PerlIOBase(f)->flags & PERLIO_F_RDBUF) {
PerlIOCrlf *c = PerlIOSelf(f, PerlIOCrlf);
- if ((PerlIOBase(f)->flags & PERLIO_F_CRLF) && !c->nl) {
- STDCHAR *nl = b->ptr;
+ if ((PerlIOBase(f)->flags & PERLIO_F_CRLF) && (!c->nl || *c->nl == 0xd)) {
+ STDCHAR *nl = (c->nl) ? c->nl : b->ptr;
scan:
while (nl < b->end && *nl != 0xd)
nl++;
@@ -3575,6 +3575,7 @@ PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
ptr -= cnt;
}
else {
+#if 1
/*
* Test code - delete when it works ...
*/
@@ -3585,7 +3586,6 @@ PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
}
chk -= cnt;
-#ifdef USE_ATTRIBUTES_FOR_PERLIO
if (ptr != chk ) {
Perl_croak(aTHX_ "ptr wrong %p != %p fl=%08" UVxf
" nl=%p e=%p for %d", ptr, chk, flags, c->nl,