summaryrefslogtreecommitdiff
path: root/usr/src/lib/libshell/common/scripts/simplefiletree1.sh
diff options
context:
space:
mode:
authorRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-04-03 09:48:44 -0700
committerRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-04-03 09:48:44 -0700
commit3e14f97f673e8a630f076077de35afdd43dc1587 (patch)
tree9828b6b676f58d7b27dd28e00202d3f3461a5cd8 /usr/src/lib/libshell/common/scripts/simplefiletree1.sh
parent4f60987df4dcaa54a88b596f861fbf4f3382c65e (diff)
downloadillumos-gate-3e14f97f673e8a630f076077de35afdd43dc1587.tar.gz
6939349 RFE: Update ksh93 to ast-ksh.2010-03-09
6877392 ksh93 regresses 'uniq -c' performance 6887363 Korn shell 93 sometimes mishandles return value of its child process 6900314 (while true ; do true|true ; done) hang in ioctl() with SIGTTOU 6904557 wc no longer counts number of bytes correctly 6904575 cut -d with multibyte character no longer works 6904597 paste -d no longer works with multibyte characters 6904780 /usr/bin/cksum changed output in snv_128 6904870 uniq -s does not skip multibyte characters correctly 6904878 join -t no longer works with multibyte char separator 6907460 EXIT trap handlers are sometimes executed twice 6909579 libast getopt solaris compatibility broken 6920072 ksh93 tail -f, with unconditional .25s sleep and line parsing, about 37x slower than cat 6932124 mktemp in ksh93 is broken Contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
Diffstat (limited to 'usr/src/lib/libshell/common/scripts/simplefiletree1.sh')
-rw-r--r--usr/src/lib/libshell/common/scripts/simplefiletree1.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/src/lib/libshell/common/scripts/simplefiletree1.sh b/usr/src/lib/libshell/common/scripts/simplefiletree1.sh
index 5b79aae8f8..d2308394cf 100644
--- a/usr/src/lib/libshell/common/scripts/simplefiletree1.sh
+++ b/usr/src/lib/libshell/common/scripts/simplefiletree1.sh
@@ -22,8 +22,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -68,14 +67,18 @@ function add_file_to_tree
nodepath="${treename}"
for (( i=0 ; i < (${#pe[@]}-1) ; i++ )) ; do
nameref x="${nodepath}"
- [[ ! -v x.node ]] && compound -A x.nodes
+
+ # [[ -v ]] does not work for arrays because [[ -v ar ]]
+ # is equal to [[ -v ar[0] ]]. In this case we can
+ # use the output of typeset +p x.nodes
+ [[ "${ typeset +p x.nodes ; }" == "" ]] && compound -A x.nodes
nodepath+=".nodes[${pe[i]}]"
done
# insert element
nameref node="${nodepath}"
- [[ ! -v node.elements ]] && typeset -a node.elements
+ [[ "${ typeset +p node.elements ; }" == "" ]] && typeset -a node.elements
node.elements+=( "${pe[i]}" )
return 0