git: sh: Fix some parameter expansion variants ${#...}.

看板DFBSD_commit作者時間14年前 (2011/05/17 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 6ea1c53357054b48026c1fbe6223a0b674921f12 Author: Peter Avalos <pavalos@dragonflybsd.org> Date: Sat Apr 16 11:17:03 2011 -1000 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 Summary of changes: bin/sh/parser.c | 51 ++++++++++++++--------- tools/regression/bin/sh/expansion/plus-minus8.0 | 5 ++ tools/regression/bin/sh/expansion/trim7.0 | 16 +++++++ 3 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 tools/regression/bin/sh/expansion/plus-minus8.0 create mode 100644 tools/regression/bin/sh/expansion/trim7.0 http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6ea1c53357054b48026c1fbe6223a0b674921f12 -- DragonFly BSD source repository
文章代碼(AID): #1DqRGOj3 (DFBSD_commit)