Mail Archives: djgpp/1995/11/08/09:46:05
On Wed, 8 Nov 1995, Alexander V. Lukyanov wrote:
> Well, I have just seen sources of libc for djgpp, and I've found,
> that djgpp has the same bug I described before. Stdio converts
> text back to raw format to calculate ftell(),
> and if text in buffer contained plain '\n' then single '\n' will
> be converted to two characters "\r\n". This is wrong, because
> '\n' could be get from "\r\n" and from single '\n'.
> This is why ftell() can tell wrong value.
Did you try this lately with a test program? I didn't, but at least
looking at the library sources shows that ftell() indeed assumes there
was a CR for every LF, but fseek() makes the same assumption, so if you
only call fseek() with values returned by ftell(), they should work.
- Raw text -