diff options
author | Fabian Groffen <grobian@gentoo.org> | 2009-10-03 20:41:40 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2009-10-03 20:41:40 +0000 |
commit | a7aa7a7381143eeaa30871c2351271cecf130d7b (patch) | |
tree | 006fe56ff1e7fc26358c3741e3b916975d4b4ac2 | |
parent | 0fdef36d3557ea3ee64a8982e66338db2ebbd1f8 (diff) | |
download | portage-a7aa7a7381143eeaa30871c2351271cecf130d7b.tar.gz portage-a7aa7a7381143eeaa30871c2351271cecf130d7b.tar.bz2 portage-a7aa7a7381143eeaa30871c2351271cecf130d7b.zip |
only calculate spacing width for that part of the stack that we're going to print
svn path=/main/trunk/; revision=14482
-rwxr-xr-x | bin/isolated-functions.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index bb9b9a042..9041846d0 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -79,11 +79,18 @@ die() { fi local n filespacing=0 linespacing=0 # setup spacing to make output easier to read - for ((n = ${#FUNCNAME[@]} - 1; n >= 0; --n)); do + (( n = ${#FUNCNAME[@]} - 1 )) + while (( n > 0 )) ; do + [ "${FUNCNAME[${n}]}" == "qa_call" ] && break + (( n-- )) + done + (( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 )) + while (( n >= 0 )); do sourcefile=${BASH_SOURCE[${n}]} sourcefile=${sourcefile##*/} lineno=${BASH_LINENO[${n}]} ((filespacing < ${#sourcefile})) && filespacing=${#sourcefile} ((linespacing < ${#lineno})) && linespacing=${#lineno} + (( n-- )) done eerror |