[base] Fix off-by-one error in writeBlocks

I've noticed an off-by-one issue in writeBlocks which writes a character fewer than expected per block buffer in block buffering mode, when not using CRLF mode (+ adding a newline). I've implemented a patch which fixes this particular issue, but I haven't eyeballed the Core or benchmarked it thoroughly to make sure it's not a big performance regression. The only concern I have, apart from performance, is that due to the way the loop works we technically inspect the next cons cell *before* actually flushing the buffer, so it's too strict by exactly one character. I didn't know how to solve this without inverting the entire loop though, and I'm very wary of the performance impact that would have. I would appreciate feedback and comments. Is this issue worth pushing the change in the first place? Discussion period: 2 weeks
participants (1)
-
Niklas Haas