zsh:rmdir(): Don't change PWD when removing fails

This commit is contained in:
2025-02-05 16:29:09 +01:00
parent 6531800c4a
commit 767e5f3019

View File

@@ -738,8 +738,8 @@ rmdir() {
if (( $# == 1 )) && [[ $1 == '.' ]]; then
to_del="$PWD"
cd ..
command rmdir "$to_del"
pushd -q ..
command rmdir "$to_del" || popd -q
else
command rmdir "$@"
fi