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>
This commit is contained in:
Phillip Wood 2022-02-22 18:53:32 +00:00 committed by Junio C Hamano
parent b80121027d
commit 24d7ce383a

View file

@ -385,7 +385,7 @@ int read_key_without_echo(struct strbuf *buf)
ch = getchar();
if (ch == EOF)
return 0;
break;
strbuf_addch(buf, ch);
}
}