Mail Archives: djgpp/1996/10/02/02:30:02
> It seems that the failure occurs when a line break is on a
> mutilple of 16384 bytes (the value of BUFSIZ in stdio.h).
> Line breaks in MSDOS are <cr><lf> pairs, but in the internal buffer
> a line break is only <lf>. Ftell scans the unread part of the buffer
> to account for stripped <cr>'s, but if the buffer ends with a <cr>
> this is currently not seen by ftell.
Take a look at the alpha snapshots' libc. The problem you describe and many
others are fixed there.
To fix ftell/fseek, it was needed to make stdio buffers hold non-processed
raw data, thus avoiding all collisions with hidden cr's.
- Raw text -