From 6f7d1af269eed4b42daeb9c6dfd2ba62f9cd47e4 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 13 Apr 2018 12:10:23 +0100 Subject: ash: make loopnest a global variable Fixes the test ash-misc/break5.tests. --- shell/ash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index 3e3193eba..a8ba9c4ef 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -434,6 +434,7 @@ struct globals_misc { int rootpid; /* pid of main shell */ /* shell level: 0 for the main shell, 1 for its children, and so on */ int shlvl; + int loopnest; /* current loop nesting level */ #define rootshell (!shlvl) int errlinno; @@ -522,6 +523,7 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc; #define rootpid (G_misc.rootpid ) #define shlvl (G_misc.shlvl ) #define errlinno (G_misc.errlinno ) +#define loopnest (G_misc.loopnest ) #define minusc (G_misc.minusc ) #define curdir (G_misc.curdir ) #define physdir (G_misc.physdir ) @@ -9369,7 +9371,6 @@ defun(union node *func) #define SKIPFUNC (1 << 2) static smallint evalskip; /* set to SKIPxxx if we are skipping commands */ static int skipcount; /* number of levels to skip */ -static int loopnest; /* current loop nesting level */ static int funcline; /* starting line number of current function, or 0 if not in a function */ /* Forward decl way out to parsing code - dotrap needs it */ -- cgit v1.2.3-55-g6feb