mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
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:
parent
b5ca54c56e
commit
8fe5dde4b8
2 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue