Skip to content

Commit 981cad0

Browse files
committed
1 parent bbeae59 commit 981cad0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

commands/fs-path.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function __process() (
143143
# `-m` on fedora/GNU will resolve with success exit status
144144
# macos only has `-f`, fedora/GNU has `-<f|e|m>`
145145
# so do `-f` which is macos and fedora, and if it is empty (fedora/GNU) then fill with `-m` but keep `-f`'s exit status
146-
resolution="$(readlink -f -- "$path" || :)"
146+
resolution="$(readlink -f -- "$path")" || symlink_status=9
147147
if [[ -z $resolution ]]; then
148148
symlink_status=9 # EBADF 9 Bad file descriptor
149149
resolution="$(readlink -m -- "$path" || :)"
@@ -180,6 +180,7 @@ function __process() (
180180
# reset lineage: shouldn't be necessary
181181
# accessible=''
182182
# reiterate on the resolved path, without further resolutions, to resolve synthetics and relatives, and validation
183+
# can't do validation earlier, as `[[ -<...> ]]` behave differently on synthetic and relative paths within a symlink dir, see earlier note
183184
if_missing_it_is_because_of_symlink='yes'
184185
if [[ ${resolution:0:1} == '/' ]]; then
185186
# absolute, replace

0 commit comments

Comments
 (0)