From 55f98600d41eaf1c16363bdc6d69681818ff2808 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 10 Nov 2019 16:11:58 -0500 Subject: [PATCH] fix bug after a bash completion --- err | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/err b/err index 132a137..5d15407 100644 --- a/err +++ b/err @@ -95,12 +95,20 @@ err-catch() { ####################################### _err-bash-trace-interactive() { + if (( ${#FUNCNAME[@]} <= 1 )); then + return 0 + fi + + for pattern in "${err_catch_ignore[@]}"; do + # shellcheck disable=SC2053 + if [[ ${BASH_SOURCE[1]} == $pattern ]]; then + return 0 + fi + done + local ret bash_command argc pattern i last last=$_err_func_last _err_func_last=${#FUNCNAME[@]} - if (( _err_func_last <= 1 )); then - return 0 - fi # We have these passed to us because they are lost inside the # function. ret=$1 @@ -108,12 +116,6 @@ _err-bash-trace-interactive() { argc=$(( $3 - 1 )) shift 3 argv=("$@") - for pattern in "${err_catch_ignore[@]}"; do - # shellcheck disable=SC2053 - if [[ ${BASH_SOURCE[1]} == $pattern ]]; then - return 0 - fi - done # The trap returns a nonzero, then gets called again. This condition # tells us if we are the first. if (( _err_func_last > last )); then -- 2.25.1