DragonFly BSD
DragonFly commits List (threaded) for 2011-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Peter Avalos <pavalos@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Apr 2011 15:06:13 -0700 (PDT)

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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]