]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
lib/varstash: fix handling of exported vars with Zsh 5.3+
authorDaniel Hahler <git@thequod.de>
Sun, 23 Apr 2017 19:49:06 +0000 (21:49 +0200)
committerDaniel Hahler <git@thequod.de>
Wed, 26 Apr 2017 19:50:11 +0000 (21:50 +0200)
Upstream PR: https://github.com/cxreg/smartcd/pull/51

lib/varstash

index 26b2e7286f6f32d987c711d5f071a82b1e62a48b..dd5096915e2bbb02939afb3d5628cb9f20ee0305 100644 (file)
@@ -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\""