summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2022-02-22 18:53:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-23 21:30:06 (GMT)
commit24d7ce383a3d92feae6a641499448fde43206fd8 (patch)
treeec832b5aa257ea774768cb8bdded64966d99030a /compat
parentb80121027d1247a0754b3cc46897fee75c050b44 (diff)
downloadgit-24d7ce383a3d92feae6a641499448fde43206fd8.zip
git-24d7ce383a3d92feae6a641499448fde43206fd8.tar.gz
git-24d7ce383a3d92feae6a641499448fde43206fd8.tar.bz2
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>
Diffstat (limited to 'compat')
-rw-r--r--compat/terminal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/terminal.c b/compat/terminal.c
index 5b903e7..fb8c70a 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);
}
}