aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c3
-rw-r--r--shell/ash_test/ash-misc/local2.right1
-rwxr-xr-xshell/ash_test/ash-misc/local2.tests1
3 files changed, 5 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index a2e06184b..0d7cac0b5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8987,6 +8987,9 @@ localcmd(int argc UNUSED_PARAM, char **argv)
8987{ 8987{
8988 char *name; 8988 char *name;
8989 8989
8990 if (!funcnest)
8991 ash_msg_and_raise_error("not in a function");
8992
8990 argv = argptr; 8993 argv = argptr;
8991 while ((name = *argv++) != NULL) { 8994 while ((name = *argv++) != NULL) {
8992 mklocal(name); 8995 mklocal(name);
diff --git a/shell/ash_test/ash-misc/local2.right b/shell/ash_test/ash-misc/local2.right
new file mode 100644
index 000000000..630ef7979
--- /dev/null
+++ b/shell/ash_test/ash-misc/local2.right
@@ -0,0 +1 @@
./local2.tests: local: line 1: not in a function
diff --git a/shell/ash_test/ash-misc/local2.tests b/shell/ash_test/ash-misc/local2.tests
new file mode 100755
index 000000000..8e14037c5
--- /dev/null
+++ b/shell/ash_test/ash-misc/local2.tests
@@ -0,0 +1 @@
local x=1