summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2009-10-03 20:41:40 +0000
committerFabian Groffen <grobian@gentoo.org>2009-10-03 20:41:40 +0000
commita7aa7a7381143eeaa30871c2351271cecf130d7b (patch)
tree006fe56ff1e7fc26358c3741e3b916975d4b4ac2 /bin/isolated-functions.sh
parentFix race condition when using a fork inside _test_pty_eof(). (diff)
downloadportage-idfetch-a7aa7a7381143eeaa30871c2351271cecf130d7b.tar.gz
portage-idfetch-a7aa7a7381143eeaa30871c2351271cecf130d7b.tar.bz2
portage-idfetch-a7aa7a7381143eeaa30871c2351271cecf130d7b.zip
only calculate spacing width for that part of the stack that we're going to print
svn path=/main/trunk/; revision=14482
Diffstat (limited to 'bin/isolated-functions.sh')
-rwxr-xr-xbin/isolated-functions.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index bb9b9a04..9041846d 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