From 0f05b5f05ad905711d180ef965dd6b245941bade Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 8 Dec 2014 13:19:42 +0000 Subject: 33931: reset errflag before precmd() --- Src/init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Src/init.c b/Src/init.c index 3cbd4e522..305908724 100644 --- a/Src/init.c +++ b/Src/init.c @@ -118,6 +118,14 @@ loop(int toplevel, int justonce) if (interact && toplevel) { int hstop = stophist; stophist = 3; + /* + * Reset all errors including the interrupt error status + * immediately, so preprompt runs regardless of what + * just happened. We'll reset again below as a + * precaution to ensure we get back to the command line + * no matter what. + */ + errflag = 0; preprompt(); if (stophist != 3) hbegin(1); -- cgit 1.4.1