]> git.ipfire.org Git - thirdparty/git.git/commitdiff
terminal: always reset terminal when reading without echo
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 22 Feb 2022 18:53:32 +0000 (18:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Feb 2022 21:30:06 +0000 (13:30 -0800)
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>
compat/terminal.c

index 5b903e7c7e3e32c25e59efcc151217d00d243d65..fb8c70a625118e96dd93b791d83bbfedd71dad1f 100644 (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);
                }
        }