dereference symlinked datafile

Closes #163
This commit is contained in:
rupa committed 2017-07-26 19:27:33 -04:00
1 parent 3eb64444d7
commit 0a47c9ceca
1 file changed
+3
+3
View File
@@ -31,6 +31,9 @@ _z() {
local datafile="${_Z_DATA:-$HOME/.z}"
# if symlink, dereference
[ -h "$datafile" ] && datafile=$(readlink "$datafile")
# bail if we don't own ~/.z and $_Z_OWNER not set
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return