From a7aa7a7381143eeaa30871c2351271cecf130d7b Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 3 Oct 2009 20:41:40 +0000 Subject: [PATCH] only calculate spacing width for that part of the stack that we're going to print svn path=/main/trunk/; revision=14482 --- bin/isolated-functions.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.26.2