From 86229fdf09e2c69576000b0f83edb35148096452 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 10 Sep 2015 16:02:27 +0100 Subject: 36468: Fix infinite loop exiting from Zle widget. If the exit was while we were waiting to complete a lexical expression we might not exit from the loop. --- ChangeLog | 4 ++++ Src/hist.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index b9bb8a575..bf7f27edf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-09-10 Peter Stephenson + * 36468: Src/hist.c: Infinite loop if we tried to exit from a + Zle widget but the lexer thought the current lexical expression + needed finishing. + * 36460: Test/E01options.ztst: Discard benign error on failure to write to pipe with no one reading. diff --git a/Src/hist.c b/Src/hist.c index 75e809c48..9c42d85c9 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -390,6 +390,12 @@ ihgetc(void) { int c = ingetc(); + if (exit_pending) + { + lexstop = 1; + errflag |= ERRFLAG_ERROR; + return ' '; + } qbang = 0; if (!stophist && !(inbufflags & INP_ALIAS)) { /* If necessary, expand history characters. */ -- cgit 1.4.1