Skip to content

Commit 24d7ce3

Browse files
phillipwoodgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b801210 commit 24d7ce3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/terminal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ int read_key_without_echo(struct strbuf *buf)
385385

386386
ch = getchar();
387387
if (ch == EOF)
388-
return 0;
388+
break;
389389
strbuf_addch(buf, ch);
390390
}
391391
}

0 commit comments

Comments
 (0)