From 8cb1fc42f1e999fa2ca117c7e1ae187287d7f493 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 20 Jan 2008 18:58:37 +0000 Subject: [PATCH] Only calculate the space (width) for functions/line numbers that are actually going to be printed in the stack. This commit is eligable for merging in the trunk. svn path=/main/branches/prefix/; revision=9211 --- 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 c6f53bc17..6deaaf695 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -59,11 +59,18 @@ diefunc() { 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