diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-08-11 10:25:15 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-08-11 10:25:15 +0000 |
commit | e949e37c57a7b8894b837a34a436233508daf2e1 (patch) | |
tree | 66357da41da47fff5b42e22bcd65c5e22744a66d /perlio.c | |
parent | ed423f7afb5038546a92d00ca689992f3e08bc61 (diff) | |
download | perl-e949e37c57a7b8894b837a34a436233508daf2e1.tar.gz |
Fix for [perl #15986] tell/seek misbehave for :crlf
Test from "Vadim Konovalov" <vkonovalov@peterstar.ru>
fix by Nick I-S based on study of problem based
on Vadim's analysis.
p4raw-id: //depot/perlio@17709
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3839,13 +3839,16 @@ PerlIOCrlf_get_cnt(pTHX_ PerlIO *f) b->ptr++; /* say we have read it as far as * flush() is concerned */ b->buf++; /* Leave space in front of buffer */ + /* Note as we have moved buf up flush's + posn += ptr-buf + will naturally make posn point at CR + */ b->bufsiz--; /* Buffer is thus smaller */ code = PerlIO_fill(f); /* Fetch some more */ b->bufsiz++; /* Restore size for next time */ b->buf--; /* Point at space */ b->ptr = nl = b->buf; /* Which is what we hand * off */ - b->posn--; /* Buffer starts here */ *nl = 0xd; /* Fill in the CR */ if (code == 0) goto test; /* fill() call worked */ |