summaryrefslogtreecommitdiff
path: root/src/ask-password-api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ask-password-api.c')
-rw-r--r--src/ask-password-api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
index f43075e601..dd54fb6abf 100644
--- a/src/ask-password-api.c
+++ b/src/ask-password-api.c
@@ -180,7 +180,6 @@ int ask_password_tty(
}
if (ttyfd >= 0)
- loop_write(ttyfd, "\n", 1, false);
passphrase[p] = 0;
@@ -196,8 +195,11 @@ finish:
close_nointr_nofail(notify);
if (ttyfd >= 0) {
- if (reset_tty)
+
+ if (reset_tty) {
+ loop_write(ttyfd, "\n", 1, false);
tcsetattr(ttyfd, TCSADRAIN, &old_termios);
+ }
close_nointr_nofail(ttyfd);
}