From ec57c91b586a7682fcdb08c3704c9214cddfa5e7 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 13 May 2015 16:17:04 +0100 Subject: users/20203: nested functions in always blocks when exit pending --- Src/builtin.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index ffde5c916..70e75ff17 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -4788,6 +4788,11 @@ bin_getopts(UNUSED(char *name), char **argv, UNUSED(Options ops), UNUSED(int fun mod_export int exit_pending; +/* Shell level at which we exit if exit_pending */ +/**/ +mod_export int +exit_level; + /* break, bye, continue, exit, logout, return -- most of these take * * one numeric argument, and the other (logout) is related to return. * * (return is treated as a logout when in a login shell.) */ @@ -4865,6 +4870,7 @@ bin_break(char *name, char **argv, UNUSED(Options ops), int func) retflag = 1; breaks = loops; exit_pending = (num << 1) | 1; + exit_level = locallevel; } } else zexit(num, 0); -- cgit v1.2.3