ash: only allow local variables in functions
No binary (build failed)
—
(log yok)
| @@ -8987,6 +8987,9 @@ localcmd(int argc UNUSED_PARAM, char **argv) | |
| { | |
| char *name; | |
| + | if (!funcnest) |
| + | ash_msg_and_raise_error("not in a function"); |
| + | |
| argv = argptr; | |
| while ((name = *argv++) != NULL) { | |
| mklocal(name); | |
| @@ -0,0 +1 @@ | |
| + | ./local2.tests: local: line 1: not in a function |
| @@ -0,0 +1 @@ | |
| + | local x=1 |