Thread (9 messages) 9 messages, 1 author, 2022-02-22
STALE1577d

[PATCH v2 1/4] terminal: always reset terminal when reading without echo

From: Phillip Wood via GitGitGadget <hidden>
Date: 2022-02-22 18:53:43
Subsystem: the rest · Maintainer: Linus Torvalds

From: Phillip Wood <redacted>

Break out of the loop to ensure restore_term() is called before
returning.

Signed-off-by: Phillip Wood <redacted>
---
 compat/terminal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/terminal.c b/compat/terminal.c
index 5b903e7c7e3..fb8c70a6251 100644
--- a/compat/terminal.c
+++ b/compat/terminal.c
@@ -385,7 +385,7 @@ int read_key_without_echo(struct strbuf *buf)
 
 			ch = getchar();
 			if (ch == EOF)
-				return 0;
+				break;
 			strbuf_addch(buf, ch);
 		}
 	}
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help