diff --git a/check.t b/check.t index 60f41d9..1326c4a 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.376 2010/05/16 19:04:40 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.377 2010/05/16 19:17:41 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -4500,6 +4500,22 @@ expected-stderr-pattern: /bad substitution/ expected-exit: 1 --- +name: xxx-variable-syntax-2 +stdin: + set 0 + echo ${*:0} +expected-stderr-pattern: + /bad substitution/ +expected-exit: 1 +--- +name: xxx-variable-syntax-3 +stdin: + set -A foo 0 + echo ${foo[*]:0} +expected-stderr-pattern: + /bad substitution/ +expected-exit: 1 +--- name: xxx-substitution-eval-order description: Check order of evaluation of expressions diff --git a/eval.c b/eval.c index 8f8711e..eb5dbc3 100644 --- a/eval.c +++ b/eval.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.88 2010/05/16 19:04:41 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.89 2010/05/16 19:17:42 tg Exp $"); /* * string expansion @@ -1045,6 +1045,8 @@ varsub(Expand *xp, const char *sp, const char *word, case '%': /* can't trim a vector (yet) */ case '#': case '?': + case '0': + case '/': return (-1); } XPinit(wv, 32);