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 <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Feb 22, 2022 at 18:53 UTC 24d7ce383a3d92feae6a641499448fde43206fd8
1 file changed +1 -1
compat/terminal.c
+1 -1
@@ -385,7 +385,7 @@ int read_key_without_echo(struct strbuf *buf)
385
386 ch = getchar();
387 if (ch == EOF)
388 - return 0;
388 + break;
389 strbuf_addch(buf, ch);
390 }
391 }