mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
fix variable leakage within autojump
This commit is contained in:
parent
6a529f4f92
commit
9d8152f7e2
@ -59,6 +59,7 @@ j() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local output
|
||||||
output="$(autojump ${@})"
|
output="$(autojump ${@})"
|
||||||
if [[ -d "${output}" ]]; then
|
if [[ -d "${output}" ]]; then
|
||||||
if [ -t 1 ]; then # if stdout is a terminal, use colors
|
if [ -t 1 ]; then # if stdout is a terminal, use colors
|
||||||
@ -94,6 +95,7 @@ jo() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local output
|
||||||
output="$(autojump ${@})"
|
output="$(autojump ${@})"
|
||||||
if [[ -d "${output}" ]]; then
|
if [[ -d "${output}" ]]; then
|
||||||
case ${OSTYPE} in
|
case ${OSTYPE} in
|
||||||
|
@ -14,7 +14,7 @@ fi
|
|||||||
|
|
||||||
# prevent circular loop for sh shells
|
# prevent circular loop for sh shells
|
||||||
if [ "${shell}" = "sh" ]; then
|
if [ "${shell}" = "sh" ]; then
|
||||||
return 0
|
:
|
||||||
|
|
||||||
# check local install
|
# check local install
|
||||||
elif [ -s ~/.autojump/share/autojump/autojump.${shell} ]; then
|
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
|
elif [ -s /usr/local/share/autojump/autojump.${shell} ]; then
|
||||||
source /usr/local/share/autojump/autojump.${shell}
|
source /usr/local/share/autojump/autojump.${shell}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset shell
|
||||||
|
Loading…
Reference in New Issue
Block a user