Simon Josefsson <jas(a)extundo.com> writes:
However, recent Cyrus IMAPD imtest uses some other approach, so it
works
better. Please try it. (I don't remember whether the approach was to not
use fgets() or set the terminal into returning character-by-characters
instead of line-by-line.)
The imtest included in cyrus-imapd 2.1.3 which was released 7 Mar 2002
doesn't seem to do this:
if (fgets(buf, sizeof (buf) - 1, stdin) == NULL) {
printf(LOGOUT);
prot_write(pout, LOGOUT, sizeof (LOGOUT));
FD_CLR(0, &read_set);
} else {
count = strlen(buf);
buf[count - 1] = '\r';
buf[count] = '\n';
buf[count + 1] = '\0';
prot_write(pout, buf, count + 1);
}
However this seems like an easy fix... if what fgets reads in doesn't
end in a \n, don't make the last chars \r\n. I'll send a patch to the
cyrus people later.
--Jered