summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-12-22 12:26:32 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-12-22 12:26:32 +0000
commitba7abf9d1538e18db741ea51e49e01e9ac1ea8a2 (patch)
treeda5a98637c501f1be6c6b4ddef65274081624fda /perlio.c
parentf2b27c0ebcd845b38b64790a1a1a6ac3dbdb148e (diff)
downloadperl-ba7abf9d1538e18db741ea51e49e01e9ac1ea8a2.tar.gz
Correct checking code which Ilya spotted was tripped by CR at EOF.
Also tone down perl -DP tracing of sv_gets. p4raw-id: //depot/perlio@13847
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/perlio.c b/perlio.c
index d4c2e11dda..b232685013 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3576,18 +3576,10 @@ PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
/*
* Test code - delete when it works ...
*/
- STDCHAR *chk;
- if (c->nl)
- chk = c->nl + 1;
- else {
- chk = b->end;
- if ((flags & PERLIO_F_CRLF) && chk > b->buf && chk[-1] == 0xd)
- chk--;
- }
+ STDCHAR *chk = (c->nl) ? (c->nl+1) : b->end;
chk -= cnt;
if (ptr != chk) {
- dTHX;
Perl_croak(aTHX_ "ptr wrong %p != %p fl=%08" UVxf
" nl=%p e=%p for %d", ptr, chk, flags, c->nl,
b->end, cnt);