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?
--Jered