Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de wrote:
Appended a changed test case, writing one single line. It starts to fail when the file, including CR and LF gets bigger then 512 bytes. This hits probably /* in text mode, strip \r if followed by \n. * BUG: should save state across calls somehow, so CR LF that * straddles buffer boundary gets recognized properly? */
So it turns out all 'a' obscures the problem. Here's a better test case. We're seeking to one byte too far in the file, and in this test, the last 510 bytes returned are off by one.