related to 1004BF041CB522EEEE3 ${foo[*]} is a vector too; add testcases

This commit is contained in:
tg 2010-05-16 19:17:42 +00:00
parent f24e2c80a9
commit 549c510269
2 changed files with 20 additions and 2 deletions

18
check.t
View File

@ -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

4
eval.c
View File

@ -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);