a3f709b
diff -up mksh-39c/check.t.fixsubst mksh-39c/check.t
a3f709b
--- mksh-39c/check.t.fixsubst	2011-01-04 15:55:30.493395051 +0100
a3f709b
+++ mksh-39c/check.t	2011-01-04 15:57:48.681133798 +0100
a3f709b
@@ -4452,6 +4452,22 @@ expected-stderr-pattern:
a3f709b
 	/bad substitution/
a3f709b
 expected-exit: 1
a3f709b
 ---
a3f709b
+name: xxx-variable-syntax-2
a3f709b
+stdin:
a3f709b
+	set 0
a3f709b
+	echo ${*:0}
a3f709b
+expected-stderr-pattern:
a3f709b
+	/bad substitution/
a3f709b
+expected-exit: 1
a3f709b
+---
a3f709b
+name: xxx-variable-syntax-3
a3f709b
+stdin:
a3f709b
+	set -A foo 0
a3f709b
+	echo ${foo[*]:0}
a3f709b
+expected-stderr-pattern:
a3f709b
+	/bad substitution/
a3f709b
+expected-exit: 1
a3f709b
+---
a3f709b
 name: xxx-substitution-eval-order
a3f709b
 description:
a3f709b
 	Check order of evaluation of expressions
a3f709b
diff -up mksh-39c/eval.c.fixsubst mksh-39c/eval.c
a3f709b
--- mksh-39c/eval.c.fixsubst	2010-02-25 21:18:39.000000000 +0100
a3f709b
+++ mksh-39c/eval.c	2011-01-04 15:55:30.500394934 +0100
a3f709b
@@ -1016,6 +1016,8 @@ varsub(Expand *xp, const char *sp, const
a3f709b
 		case '=':	/* can't assign to a vector */
a3f709b
 		case '%':	/* can't trim a vector (yet) */
a3f709b
 		case '#':
a3f709b
+		case '0':
a3f709b
+		case '/':
a3f709b
 			return (-1);
a3f709b
 		}
a3f709b
 		if (e->loc->argc == 0) {
a3f709b
@@ -1039,6 +1041,8 @@ varsub(Expand *xp, const char *sp, const
a3f709b
 			case '%':	/* can't trim a vector (yet) */
a3f709b
 			case '#':
a3f709b
 			case '?':
a3f709b
+			case '0':
a3f709b
+			case '/':
a3f709b
 				return (-1);
a3f709b
 			}
a3f709b
 			XPinit(wv, 32);