]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - autoenv.zsh
_autoenv_get_file_upwards: do not dereference symlinks (#73)
[zsh-autoenv.git] / autoenv.zsh
index 47d9e1392994f0ccec806d2e1cf6e2fcaab977f1..2deac546596dda7728b1934d1602bcf39ffbbd5d 100644 (file)
@@ -290,7 +290,7 @@ _autoenv_source() {
   # XXX: pollutes environment with e.g. `stash`, and `autostash` will cause
   # an overwritten `stash` function to be called!
   if ! (( $+functions[autostash] )); then
-    if \grep -qE '\b(autostash|autounstash|stash)\b' $autoenv_env_file; then
+    if \grep -qE '\b(autostash|autounstash|stash|unstash)\b' $autoenv_env_file; then
       source ${${funcsourcetrace[1]%:*}:h}/lib/varstash
     fi
     # NOTE: Varstash uses $PWD as default for varstash_dir, we might set it to
@@ -339,7 +339,7 @@ _autoenv_get_file_upwards() {
       if [[ ${parent_file[1,2]} == './' ]]; then
         echo ${parent_file#./}
       else
-        echo ${parent_file:A}
+        echo ${parent_file:a}
       fi
       break
     fi
@@ -403,7 +403,7 @@ _autoenv_chpwd_handler() {
       if ! [[ ${PWD}/ == ${prev_dir}/* ]]; then
         local env_file_leave=$prev_dir/$AUTOENV_FILE_LEAVE
         if _autoenv_check_authorized_env_file $env_file_leave; then
-          _autoenv_source $env_file_leave leave $prev_dir
+          varstash_dir=$prev_dir _autoenv_source $env_file_leave leave $prev_dir
         fi
 
         # Unstash any autostashed stuff.