Return zero when listing with -l (#212)

Current logic returns a non-zero code, because `"$cd"` is empty when
using `-l`.
This commit is contained in:
Eric Nielsen authored and GitHub committed 2020-03-05 23:54:22 -05:00
1 parent f1f113d9ba
commit 379a72dc5d
1 file changed
+5 -3
+5 -3
View File
@@ -205,9 +205,11 @@ _z() {
}
')"
[ $? -eq 0 ] && [ "$cd" ] && {
if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi
}
[ "$?" -eq 0 ] && if [ "$cd" ]; then
if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi
else
[ -n "$list" ]
fi
fi
}