Date: Wed, 8 Nov 1995 13:20:57 +0200 (IST) From: Eli Zaretskii To: "Alexander V. Lukyanov" Cc: lav AT yars DOT free DOT net, djgpp AT sun DOT soe DOT clarkson DOT edu, jkmarsha AT socs DOT uts DOT edu DOT au, kagel AT ts1 DOT bloomberg DOT com, DJ Delorie Subject: Re: CR/LF pairs... NO NO NO! 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.