diff --git a/autoenv.zsh b/autoenv.zsh index 4ccc9ae..2deac54 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -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 diff --git a/tests/_autoenv_utils.t b/tests/_autoenv_utils.t index a23f189..c77779f 100644 --- a/tests/_autoenv_utils.t +++ b/tests/_autoenv_utils.t @@ -17,6 +17,15 @@ Should not get the file from the current dir. $ _autoenv_get_file_upwards $PWD file */_autoenv_utils.t/sub/file (glob) +_autoenv_get_file_upwards should not dereference symlinks. + + $ cd ../.. + $ ln -s sub symlink + $ cd symlink/sub2 + $ _autoenv_get_file_upwards . file + ../file + $ _autoenv_get_file_upwards $PWD file + */_autoenv_utils.t/symlink/file (glob) Tests for _autoenv_authorize. {{{