bug#81513: 30.2; Maybe unneeded test in dired-create-files
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> From: Thierry Volpiatto <[email protected]> > Cc: Thierry Volpiatto <[email protected]>, [email protected] > Date: Wed, 29 Jul 2026 13:17:10 +0000 > > Eli Zaretskii <[email protected]> writes: > > >> From: Thierry Volpiatto <[email protected]> > >> Date: Wed, 29 Jul 2026 04:54:25 +0000 > >> > >> > >> In dired-create-files, we have this code: > >> > >> (let ((destname (file-name-directory to))) > >> (when (and (file-directory-p from) > >> (file-directory-p to) > >> (eq file-creator 'dired-copy-file)) > >> (setq to destname)) > >> ;; If DESTNAME is a subdirectory of FROM, not a symlink, > >> ;; and the method in use is copying, signal an error. > >> (and (eq t (file-attribute-type (file-attributes destname))) > >> (eq file-creator 'dired-copy-file) > >> (file-in-directory-p destname from) > >> (error "Cannot copy `%s' into its subdirectory `%s'" > >> from to))) > >> > >> Is the test (eq t (file-attribute-type (file-attributes destname))) > >> really needed? > >> AFAIU destname is always a directory, isn't it? > > > > Doesn't the comment explain the reason? DESTNAME could be a symlink, > > couldn't it be? > > Oh yes, of course, sorry for the noise, thanks! No problem, closing.