Fix line termination for response wait feature

The response wait feature waited for a line response, a string
terminated with either CR or NL. However, some devices may send a CR and
then their line content and then NL. This means tio will quit before
receiving and printing the line response. To solve this we simply ignore
the CR character and only consider lines terminated with a NL character.

This should work for all devices as lines are AFAIK always terminated
with either CRNL or a NL.
This commit is contained in:
Martin Lund 2023-04-20 17:28:39 +02:00
parent b5ca54c56e
commit 8fe5dde4b8
2 changed files with 3 additions and 3 deletions

View file

@ -1426,7 +1426,7 @@ int tty_connect(void)
if (option.response_wait)
{
if ((input_char == '\r') || (input_char == '\n'))
if (input_char == '\n')
{
tty_sync(fd);
exit(EXIT_SUCCESS);