From 9d8152f7e2279631486036aa7d5504d6fd04990e Mon Sep 17 00:00:00 2001 From: Evan Klitzke Date: Thu, 17 May 2018 17:18:50 -0700 Subject: [PATCH] fix variable leakage within autojump --- bin/autojump.bash | 2 ++ bin/autojump.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/autojump.bash b/bin/autojump.bash index 379e529..8b51c09 100644 --- a/bin/autojump.bash +++ b/bin/autojump.bash @@ -59,6 +59,7 @@ j() { return fi + local output output="$(autojump ${@})" if [[ -d "${output}" ]]; then if [ -t 1 ]; then # if stdout is a terminal, use colors @@ -94,6 +95,7 @@ jo() { return fi + local output output="$(autojump ${@})" if [[ -d "${output}" ]]; then case ${OSTYPE} in diff --git a/bin/autojump.sh b/bin/autojump.sh index 0ddff47..75ba641 100644 --- a/bin/autojump.sh +++ b/bin/autojump.sh @@ -14,7 +14,7 @@ fi # prevent circular loop for sh shells if [ "${shell}" = "sh" ]; then - return 0 + : # check local install elif [ -s ~/.autojump/share/autojump/autojump.${shell} ]; then @@ -24,3 +24,5 @@ elif [ -s ~/.autojump/share/autojump/autojump.${shell} ]; then elif [ -s /usr/local/share/autojump/autojump.${shell} ]; then source /usr/local/share/autojump/autojump.${shell} fi + +unset shell