mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Cleanup parsing of mapping flags
This commit is contained in:
parent
563c4fa6ea
commit
8014ef68c0
6 changed files with 186 additions and 152 deletions
|
|
@ -343,20 +343,20 @@ bool socket_handle_input(fd_set *rdfs, char *output_char)
|
|||
}
|
||||
|
||||
/* If INLCR is set, a received NL character shall be translated into a CR character */
|
||||
if (*output_char == '\n' && map_i_nl_cr)
|
||||
if (*output_char == '\n' && option.map_i_nl_cr)
|
||||
{
|
||||
*output_char = '\r';
|
||||
}
|
||||
else if (*output_char == '\r')
|
||||
{
|
||||
/* If IGNCR is set, a received CR character shall be ignored (not read). */
|
||||
if (map_ign_cr)
|
||||
if (option.map_ign_cr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If IGNCR is not set and ICRNL is set, a received CR character shall be translated into an NL character. */
|
||||
if (map_i_cr_nl)
|
||||
if (option.map_i_cr_nl)
|
||||
{
|
||||
*output_char = '\n';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue