From: Phillip Wood Date: Tue, 22 Feb 2022 18:53:32 +0000 (+0000) Subject: terminal: always reset terminal when reading without echo X-Git-Tag: v2.36.0-rc0~53^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24d7ce383a3d92feae6a641499448fde43206fd8;p=thirdparty%2Fgit.git terminal: always reset terminal when reading without echo Break out of the loop to ensure restore_term() is called before returning. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- diff --git a/compat/terminal.c b/compat/terminal.c index 5b903e7c7e..fb8c70a625 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); } }