Cleanup parsing of mapping flags

This commit is contained in:
Martin Lund 2024-06-02 14:26:39 +02:00
parent 563c4fa6ea
commit 8014ef68c0
6 changed files with 186 additions and 152 deletions

View file

@ -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';
}