From 2036b1ebe815651485e072a14948196c87b5dcc1 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Sun, 8 May 2016 22:41:18 +0200 Subject: [PATCH] Fixed setting "tainted" Set "tainted" if and only if any character was read from the device. Ctrl-t is no longer sent to the device on exit, so the trick to avoid its echo is not necessary. Characters read from stdin don't directly affect output, so they shouldn't enable "tainted". --- src/tty.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/tty.c b/src/tty.c index b7a9fd7..fa8b57c 100644 --- a/src/tty.c +++ b/src/tty.c @@ -228,8 +228,7 @@ int connect_tty(void) if (option.log) log_write(c_tty); - if (c_tty != KEY_CTRL_T) // Small trick to avoid ctrl-t echo - tainted = true; + tainted = true; } else { /* Error reading - device is likely unplugged */ @@ -244,9 +243,6 @@ int connect_tty(void) if (status < 0) printf("Warning: Could not read from stdin\r\n"); - if ((c_stdin[0] != KEY_Q) && (c_stdin[0] != KEY_CTRL_T)) - tainted = true; - /* Exit upon ctrl-t + q sequence */ c_stdin[2] = c_stdin[1]; c_stdin[1] = c_stdin[0];