summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShingo Tanaka <shingo.fg8@gmail.com>2019-10-25 22:59:28 +0900
committerEli Zaretskii <eliz@gnu.org>2019-11-16 14:54:19 +0200
commita6a9b3061f90313dfc58e3aa85d60c0a966b50dd (patch)
tree44597c2430f94a1cf4746a94cec30cd55ea55d84
parentd8f03d82760107115bcc63a461b78a53fdd2882b (diff)
downloademacs-a6a9b3061f90313dfc58e3aa85d60c0a966b50dd.tar.gz
Fix moving files with duplicate names to trash-can
* lisp/files.el (move-file-to-trash): Fix file name in trash-can when another deleted file under the same name is already stored there. (Bug#37922) Copyright-paperwork-exempt: yes.
-rw-r--r--lisp/files.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 448e00cbd75..bb77dcb3c7e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -7711,7 +7711,8 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
(setq info-fn (make-temp-file
(expand-file-name files-base trash-info-dir)
nil ".trashinfo"))
- (setq files-base (file-name-nondirectory info-fn))
+ (setq files-base (substring (file-name-nondirectory info-fn)
+ 0 (- (length ".trashinfo"))))
(write-region nil nil info-fn nil 'quiet info-fn)))
;; Finally, try to move the file to the trashcan.
(let ((delete-by-moving-to-trash nil)