From c018ad8e668e36fff70e14514bf3646f2a27fd5e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 23 Apr 2017 21:49:06 +0200 Subject: [PATCH] lib/varstash: fix handling of exported vars with Zsh 5.3+ Upstream PR: https://github.com/cxreg/smartcd/pull/51 --- lib/varstash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/varstash b/lib/varstash index 26b2e72..dd50969 100644 --- a/lib/varstash +++ b/lib/varstash @@ -146,7 +146,8 @@ function stash() { eval "__varstash_array__$stash_name=(\"\${$stash_which""[@]}\")" fi - elif [[ $vartype == $pattern" -x"* ]]; then + elif ([[ -n $ZSH_VERSION ]] && [[ $vartype == "export "* ]]) \ + || [[ $vartype == $pattern" -x"* ]]; then # variable is exported if [[ -z $already_stashed ]]; then eval "export __varstash_export__$stash_name=\"\$$stash_which\"" -- 2.44.0