summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/gui/curses/gui-curses-main.c4
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;