Jered Floyd <jered(a)mit.edu> writes:
> The solution used the other approach then, not buffering
stdin/stoud. Did
> you try it?
[...]
> Their current approach isn't too unreasonable, it converts from the
> IMAP/TCP eol character to the tty eol character. However, it would be the
> wrong thing under Windows, but I doubt it build under Windows anyway.
Sorry; I'm failing to understand this. I don't see how making stdin
unbuffered changes the behaviour of fgets() at all. fgets() can still
return because it's filled its buffer, at which point the code I quoted
would gleefully replace the last character with \r\n. Am I missing
something?
No, I didn't read carefully and thought you referred to the bug where
the OS buffers are filled and long lines are truncated. I guess it
was fixed long time ago though. Either raising the buffer size so
that long lines aren't corrupted, or doing what you suggest seems like
a very good idea.