mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 06:54:41 +08:00
telnetd: Map CRLF to CR
It is not so easy to use Termios for that. We already map CRNUL to CR, thus we cannot ignore CRs. We could change the shell code to map CRNL to a single line end, but this is more intrusive than the change here.
This commit is contained in:
@@ -306,10 +306,9 @@ static int read_pty(int minor)
|
||||
} else {
|
||||
result=value;
|
||||
if ( 0
|
||||
#if 0 /* pass CRLF through - they should use termios to handle it */
|
||||
|| ((value=='\n') && (pty->last_cr))
|
||||
#endif
|
||||
/* but map telnet CRNUL to CR down here */
|
||||
/* map CRLF to CR for symmetry */
|
||||
|| ((value=='\n') && pty->last_cr)
|
||||
/* map telnet CRNUL to CR down here */
|
||||
|| ((value==0) && pty->last_cr)
|
||||
) result=-1;
|
||||
pty->last_cr=(value=='\r');
|
||||
|
||||
Reference in New Issue
Block a user