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