"Dan" == Dan Kegel dank@kegel.com writes:
Dan> That's how we used to do it, but tests showed that _filbuf really Dan> has to do the cr removal.
Dan> On Jan 25, 2009 10:57 AM, "Uwe Bonnes" < Dan> bon@elektron.ikp.physik.tu-darmstadt.de> wrote:
"Dan" == Dan Kegel dank@kegel.com writes:
Dan> I'll have a look...
Dan> For me it looks like our whole black magic handling for the CR Dan> removal in read_i() is wrong. Probably _filbuf() should fill the Dan> buffer as is, only fget(w)c() should skip CR in text mode and Dan> fread() in binary mode should use unaltered chunks of _filbuf() in Dan> binary mode and iterate through _filbuf() in text mode, skipping Dan> CR.
Could it be that _filbuf also skips CR as return value in text mode?
B.t.w., for a file like "\r\r\r\nEOF", native _filbuf returns 0x0d...