sh: Fix some parameter expansion variants ${#...}.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sat, 16 Apr 2011 21:17:03 +0000 (11:17 -1000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sat, 16 Apr 2011 21:55:46 +0000 (11:55 -1000)
commit6ea1c53357054b48026c1fbe6223a0b674921f12
tree38fc9f11ecb1a403625ded04fc57f39dc67230e1
parentcb26c088d93655d06e1b74351c815ae6fd0e57e9
sh: Fix some parameter expansion variants ${#...}.

These already worked: $# ${#} ${##} ${#-} ${#?}
These now work as well: ${#+word} ${#-word} ${##word} ${#%word}

There is an ambiguity in the standard with ${#?}: it could be the length of
$? or it could be $# giving an error in the (impossible) case that it is not
set. We continue to use the former interpretation as it seems more useful.

Obtained-from:  FreeBSD
bin/sh/parser.c
tools/regression/bin/sh/expansion/plus-minus8.0 [new file with mode: 0644]
tools/regression/bin/sh/expansion/trim7.0 [new file with mode: 0644]