[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 867e962cf5 2/2: Fix trashing of symlink that points at a director
From: |
Eli Zaretskii |
Subject: |
master 867e962cf5 2/2: Fix trashing of symlink that points at a directory |
Date: |
Thu, 24 Nov 2022 06:18:35 -0500 (EST) |
branch: master
commit 867e962cf5318399dfc17cc53c661db4bbd3c3d1
Author: Mike Kupfer <mkupfer@alum.berkeley.edu>
Commit: Eli Zaretskii <eliz@gnu.org>
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.
---
lisp/files.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/files.el b/lisp/files.el
index 127cf77240..60c0eb917e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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