Nicholas Clark <[EMAIL PROTECTED]> writes:
>> 
>> If you read from the buffer without updating the pointer and the counter in 
>> the _iobuf structure, then I could see how that would throw off ungetc.  I 
>> assumed that's what the comment meant, but I don't know if fast_sv_gets() is 
>> really guilty of that.

It isn't - it seems to be unread() that is being unreasonable.

>
>Note that sv.c has this in sv__gets:
>
>#if defined(VMS) && defined(PERLIO_IS_STDIO)
>    /* An ungetc()d char is handled separately from the regular
>     * buffer, so we getc() it back out and stuff it in the buffer.
>     */
>    i = PerlIO_getc(fp);
>    if (i == EOF) return 0;
>    *(--((*fp)->_ptr)) = (unsigned char) i;
>    (*fp)->_cnt++;
>#endif
>
>
>which would be consistent with what I said above. (probably why I said it)
>
>How that code can know whether there is space at the start of the buffer to
>do the stuffing, I don't know.

Because it knows it is empty because it is trying to fill it ...

It seems sv.c has knowledge that has not made it to perlio.c

-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

Reply via email to