From da8f19bcee8e59d9b9e4d392d7d0067988503b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 3 Jun 2017 13:41:49 +0200 Subject: core: fix infinite loop when the terminal is closed on the secure password prompt (closes #1010) --- ChangeLog.adoc | 1 + src/gui/curses/gui-curses-main.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 711896377..58158125c 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -32,6 +32,7 @@ Improvements:: Bug fixes:: + * core: fix infinite loop when the terminal is closed on the secure password prompt (issue #1010) * buflist: fix long mouse gestures * buflist: fix slow switch of buffer when there are a lot of buffers opened (issue #998) * buflist: add option "bar" in command /buflist, do not automatically add the "buflist" bar when the option buflist.look.enabled is off (issue #994) diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 32e953691..ade0a9878 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -104,8 +104,8 @@ gui_main_get_password (const char **prompt, char *password, int size) /* enter */ if (ch == '\n') break; - /* ctrl-C */ - if (ch == 3) + /* terminal lost or ctrl-C */ + if ((ch == ERR) || (ch == 3)) { password[0] = 3; i = 1; -- cgit v1.2.3