(ioq_gets): Support telnet line termination "\r\n". Previously,
string input other than through parse() or getele() failed to strip '\r', which could end up in ship names and such. (getele): Code dealing with '\r' is now redundant, remove. It ceased to work in rev. 1.6 because input filtering replaces '\r' by '?'.
This commit is contained in:
parent
34fe99ee23
commit
95234c8e9f
2 changed files with 5 additions and 5 deletions
|
@ -163,6 +163,9 @@ ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
|
|||
actual = nbytes;
|
||||
if (actual > cc - 1)
|
||||
actual = cc - 1;
|
||||
/* telnet terminates lines with "\r\n", get rid of \r */
|
||||
if (actual > 0 && buf[actual-1] == '\r')
|
||||
actual--;
|
||||
buf[actual] = '\0';
|
||||
/* remove the newline too */
|
||||
removecc(ioq, nbytes + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue