aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-04-13 12:10:23 +0100
committerRon Yorston <rmy@pobox.com>2018-04-13 12:10:23 +0100
commit6f7d1af269eed4b42daeb9c6dfd2ba62f9cd47e4 (patch)
treeb9596beab0060b6e8e786f3c443e88c8ad823b45
parent493058551b07dd88aa79facbded8b8388aa41a75 (diff)
downloadbusybox-w32-6f7d1af269eed4b42daeb9c6dfd2ba62f9cd47e4.tar.gz
busybox-w32-6f7d1af269eed4b42daeb9c6dfd2ba62f9cd47e4.tar.bz2
busybox-w32-6f7d1af269eed4b42daeb9c6dfd2ba62f9cd47e4.zip
ash: make loopnest a global variable
Fixes the test ash-misc/break5.tests.
-rw-r--r--shell/ash.c3
1 files changed, 2 insertions, 1 deletions
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 {
434 int rootpid; /* pid of main shell */ 434 int rootpid; /* pid of main shell */
435 /* shell level: 0 for the main shell, 1 for its children, and so on */ 435 /* shell level: 0 for the main shell, 1 for its children, and so on */
436 int shlvl; 436 int shlvl;
437 int loopnest; /* current loop nesting level */
437#define rootshell (!shlvl) 438#define rootshell (!shlvl)
438 int errlinno; 439 int errlinno;
439 440
@@ -522,6 +523,7 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc;
522#define rootpid (G_misc.rootpid ) 523#define rootpid (G_misc.rootpid )
523#define shlvl (G_misc.shlvl ) 524#define shlvl (G_misc.shlvl )
524#define errlinno (G_misc.errlinno ) 525#define errlinno (G_misc.errlinno )
526#define loopnest (G_misc.loopnest )
525#define minusc (G_misc.minusc ) 527#define minusc (G_misc.minusc )
526#define curdir (G_misc.curdir ) 528#define curdir (G_misc.curdir )
527#define physdir (G_misc.physdir ) 529#define physdir (G_misc.physdir )
@@ -9369,7 +9371,6 @@ defun(union node *func)
9369#define SKIPFUNC (1 << 2) 9371#define SKIPFUNC (1 << 2)
9370static smallint evalskip; /* set to SKIPxxx if we are skipping commands */ 9372static smallint evalskip; /* set to SKIPxxx if we are skipping commands */
9371static int skipcount; /* number of levels to skip */ 9373static int skipcount; /* number of levels to skip */
9372static int loopnest; /* current loop nesting level */
9373static int funcline; /* starting line number of current function, or 0 if not in a function */ 9374static int funcline; /* starting line number of current function, or 0 if not in a function */
9374 9375
9375/* Forward decl way out to parsing code - dotrap needs it */ 9376/* Forward decl way out to parsing code - dotrap needs it */