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.
This commit is contained in:
parent
d8f03d8276
commit
a6a9b3061f
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue