From 0f1267a8aaa079a10b241acfb8eb82e52867ade2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 21 Sep 2004 14:07:41 +0000 Subject: 20398: allow clean exit from within widget function --- ChangeLog | 5 +++++ Src/Zle/zle_main.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d511f2d5d..8996a6c58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-21 Peter Stephenson + + * 20398: Src/Zle/zle_main.c: allow clean exit from within + a zle widget function. + 2004-09-20 Peter Stephenson * 20391: Src/params.c: SHLVL didn't get updated in the diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index dbe34a761..48511e017 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -680,7 +680,13 @@ zlecore(void) FD_ZERO(&foofd); #endif - while (!done && !errflag) { + /* + * A widget function may decide to exit the shell. + * We never exit directly from functions, to allow + * the shell to tidy up, so we have to test for + * that explicitly. + */ + while (!done && !errflag && !exit_pending) { statusline = NULL; vilinerange = 0; -- cgit v1.2.3