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

Peter Avalos pavalos at crater.dragonflybsd.org
Sat Apr 16 15:07:51 PDT 2011


commit 6ea1c53357054b48026c1fbe6223a0b674921f12
Author: Peter Avalos <pavalos at 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





More information about the Commits mailing list