From 0a47c9ceca790604df5c9a4a2bc74aba63005c21 Mon Sep 17 00:00:00 2001 From: rupa Date: Wed, 26 Jul 2017 19:27:33 -0400 Subject: [PATCH] dereference symlinked datafile Closes #163 --- z.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/z.sh b/z.sh index fbc2f04..c2036c6 100644 --- a/z.sh +++ b/z.sh @@ -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