Fix trashing of symlink that points at a directory

* lisp/files.el (move-file-to-trash): Redefine is-directory so
that it is false for symlinks.
This commit is contained in:
Mike Kupfer 2022-11-20 16:44:20 -08:00 committed by Eli Zaretskii
parent 95d827f21e
commit 867e962cf5

View file

@ -8566,7 +8566,8 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
;; Make a .trashinfo file. Use O_EXCL, as per trash-spec 1.0.
(let* ((files-base (file-name-nondirectory fn))
(is-directory (file-directory-p fn))
(is-directory (and (file-directory-p fn)
(not (file-symlink-p fn))))
(overwrite nil)
info-fn)
;; We're checking further down whether the info file