avoid issues when env has been aliased

Closes #325
This commit is contained in:
rupa committed 2023-12-09 17:35:12 -05:00
1 parent b82ac78a2d
commit 6ba07224f7
1 file changed
+2 -2
+2 -2
View File
@@ -95,10 +95,10 @@ _z() {
' 2>/dev/null >| "$tempfile"
# do our best to avoid clobbering the datafile in a race condition.
if [ $? -ne 0 -a -f "$datafile" ]; then
env rm -f "$tempfile"
\env rm -f "$tempfile"
else
[ "$_Z_OWNER" ] && chown $_Z_OWNER:"$(id -ng $_Z_OWNER)" "$tempfile"
env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile"
\env mv -f "$tempfile" "$datafile" || \env rm -f "$tempfile"
fi
# tab completion