1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-25 16:31:00 +02:00

lib/varstash: fix handling of exported vars with Zsh 5.3+

Upstream PR: https://github.com/cxreg/smartcd/pull/51
This commit is contained in:
Daniel Hahler 2017-04-23 21:49:06 +02:00
parent 3fc024eced
commit c018ad8e66

View File

@ -146,7 +146,8 @@ function stash() {
eval "__varstash_array__$stash_name=(\"\${$stash_which""[@]}\")" eval "__varstash_array__$stash_name=(\"\${$stash_which""[@]}\")"
fi fi
elif [[ $vartype == $pattern" -x"* ]]; then elif ([[ -n $ZSH_VERSION ]] && [[ $vartype == "export "* ]]) \
|| [[ $vartype == $pattern" -x"* ]]; then
# variable is exported # variable is exported
if [[ -z $already_stashed ]]; then if [[ -z $already_stashed ]]; then
eval "export __varstash_export__$stash_name=\"\$$stash_which\"" eval "export __varstash_export__$stash_name=\"\$$stash_which\""