diff options
-rw-r--r-- | lash.c | 17 | ||||
-rw-r--r-- | sh.c | 17 | ||||
-rw-r--r-- | shell/lash.c | 17 |
3 files changed, 45 insertions, 6 deletions
@@ -73,7 +73,7 @@ static const unsigned int IF_TRUE_CONTEXT=0x2; | |||
73 | static const unsigned int IF_FALSE_CONTEXT=0x4; | 73 | static const unsigned int IF_FALSE_CONTEXT=0x4; |
74 | static const unsigned int THEN_EXP_CONTEXT=0x8; | 74 | static const unsigned int THEN_EXP_CONTEXT=0x8; |
75 | static const unsigned int ELSE_EXP_CONTEXT=0x10; | 75 | static const unsigned int ELSE_EXP_CONTEXT=0x10; |
76 | unsigned int shell_context = 0; | 76 | unsigned int shell_context; |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
@@ -185,7 +185,7 @@ static struct built_in_command bltins_forking[] = { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | static char *cwd; | 187 | static char *cwd; |
188 | static char *local_pending_command = NULL; | 188 | static char *local_pending_command; |
189 | static struct jobset job_list = { NULL, NULL }; | 189 | static struct jobset job_list = { NULL, NULL }; |
190 | static int argc; | 190 | static int argc; |
191 | static char **argv; | 191 | static char **argv; |
@@ -1629,6 +1629,19 @@ int shell_main(int argc_l, char **argv_l) | |||
1629 | argc = argc_l; | 1629 | argc = argc_l; |
1630 | argv = argv_l; | 1630 | argv = argv_l; |
1631 | 1631 | ||
1632 | shell_context = 0; | ||
1633 | cwd=NULL; | ||
1634 | #ifdef BB_FEATURE_STANDALONE_SHELL | ||
1635 | /* These variables need re-initializing when recursing */ | ||
1636 | local_pending_command = NULL; | ||
1637 | job_list.head = NULL; | ||
1638 | job_list.fg = NULL; | ||
1639 | #ifdef BB_FEATURE_SH_ENVIRONMENT | ||
1640 | last_bg_pid=-1; | ||
1641 | last_return_code=-1; | ||
1642 | show_x_trace=FALSE; | ||
1643 | #endif | ||
1644 | #endif | ||
1632 | 1645 | ||
1633 | if (argv[0] && argv[0][0] == '-') { | 1646 | if (argv[0] && argv[0][0] == '-') { |
1634 | FILE *input; | 1647 | FILE *input; |
@@ -73,7 +73,7 @@ static const unsigned int IF_TRUE_CONTEXT=0x2; | |||
73 | static const unsigned int IF_FALSE_CONTEXT=0x4; | 73 | static const unsigned int IF_FALSE_CONTEXT=0x4; |
74 | static const unsigned int THEN_EXP_CONTEXT=0x8; | 74 | static const unsigned int THEN_EXP_CONTEXT=0x8; |
75 | static const unsigned int ELSE_EXP_CONTEXT=0x10; | 75 | static const unsigned int ELSE_EXP_CONTEXT=0x10; |
76 | unsigned int shell_context = 0; | 76 | unsigned int shell_context; |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
@@ -185,7 +185,7 @@ static struct built_in_command bltins_forking[] = { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | static char *cwd; | 187 | static char *cwd; |
188 | static char *local_pending_command = NULL; | 188 | static char *local_pending_command; |
189 | static struct jobset job_list = { NULL, NULL }; | 189 | static struct jobset job_list = { NULL, NULL }; |
190 | static int argc; | 190 | static int argc; |
191 | static char **argv; | 191 | static char **argv; |
@@ -1629,6 +1629,19 @@ int shell_main(int argc_l, char **argv_l) | |||
1629 | argc = argc_l; | 1629 | argc = argc_l; |
1630 | argv = argv_l; | 1630 | argv = argv_l; |
1631 | 1631 | ||
1632 | shell_context = 0; | ||
1633 | cwd=NULL; | ||
1634 | #ifdef BB_FEATURE_STANDALONE_SHELL | ||
1635 | /* These variables need re-initializing when recursing */ | ||
1636 | local_pending_command = NULL; | ||
1637 | job_list.head = NULL; | ||
1638 | job_list.fg = NULL; | ||
1639 | #ifdef BB_FEATURE_SH_ENVIRONMENT | ||
1640 | last_bg_pid=-1; | ||
1641 | last_return_code=-1; | ||
1642 | show_x_trace=FALSE; | ||
1643 | #endif | ||
1644 | #endif | ||
1632 | 1645 | ||
1633 | if (argv[0] && argv[0][0] == '-') { | 1646 | if (argv[0] && argv[0][0] == '-') { |
1634 | FILE *input; | 1647 | FILE *input; |
diff --git a/shell/lash.c b/shell/lash.c index 3d54b439e..c756a2749 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -73,7 +73,7 @@ static const unsigned int IF_TRUE_CONTEXT=0x2; | |||
73 | static const unsigned int IF_FALSE_CONTEXT=0x4; | 73 | static const unsigned int IF_FALSE_CONTEXT=0x4; |
74 | static const unsigned int THEN_EXP_CONTEXT=0x8; | 74 | static const unsigned int THEN_EXP_CONTEXT=0x8; |
75 | static const unsigned int ELSE_EXP_CONTEXT=0x10; | 75 | static const unsigned int ELSE_EXP_CONTEXT=0x10; |
76 | unsigned int shell_context = 0; | 76 | unsigned int shell_context; |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
@@ -185,7 +185,7 @@ static struct built_in_command bltins_forking[] = { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | static char *cwd; | 187 | static char *cwd; |
188 | static char *local_pending_command = NULL; | 188 | static char *local_pending_command; |
189 | static struct jobset job_list = { NULL, NULL }; | 189 | static struct jobset job_list = { NULL, NULL }; |
190 | static int argc; | 190 | static int argc; |
191 | static char **argv; | 191 | static char **argv; |
@@ -1629,6 +1629,19 @@ int shell_main(int argc_l, char **argv_l) | |||
1629 | argc = argc_l; | 1629 | argc = argc_l; |
1630 | argv = argv_l; | 1630 | argv = argv_l; |
1631 | 1631 | ||
1632 | shell_context = 0; | ||
1633 | cwd=NULL; | ||
1634 | #ifdef BB_FEATURE_STANDALONE_SHELL | ||
1635 | /* These variables need re-initializing when recursing */ | ||
1636 | local_pending_command = NULL; | ||
1637 | job_list.head = NULL; | ||
1638 | job_list.fg = NULL; | ||
1639 | #ifdef BB_FEATURE_SH_ENVIRONMENT | ||
1640 | last_bg_pid=-1; | ||
1641 | last_return_code=-1; | ||
1642 | show_x_trace=FALSE; | ||
1643 | #endif | ||
1644 | #endif | ||
1632 | 1645 | ||
1633 | if (argv[0] && argv[0][0] == '-') { | 1646 | if (argv[0] && argv[0][0] == '-') { |
1634 | FILE *input; | 1647 | FILE *input; |