Skip excluding when $_Z_EXCLUDE_DIRS is empty (#302)

This commit is contained in:
Queensferry authored and GitHub committed 2021-05-31 13:23:39 -04:00
1 parent 574f64b84e
commit b82ac78a2d
1 file changed
+6 -4
+6 -4
View File
@@ -60,10 +60,12 @@ _z() {
[ "$*" = "$HOME" -o "$*" = '/' ] && return
# don't track excluded directory trees
local exclude
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
case "$*" in "$exclude"*) return;; esac
done
if [ ${#_Z_EXCLUDE_DIRS[@]} -gt 0 ]; then
local exclude
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
case "$*" in "$exclude"*) return;; esac
done
fi
# maintain the data file
local tempfile="$datafile.$RANDOM"