GNU bug report logs - #38707
dired-do-rename doesn't check for "/" !

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 22 Dec 2019 16:38:01 UTC

Severity: minor

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: dired-do-rename doesn't check for "/" !
Date: Mon, 23 Dec 2019 00:37:26 +0800
R runs the command dired-do-rename (found in dired-mode-map), which is
an interactive autoloaded compiled Lisp function in ‘dired-aux.el’.

But it has a big bug.

Let's say you tell it to rename qqq to "xxx/yyy/zzz/".

And it works.

You get xxx/yyy/zzz/qqq

But if there is no directory zzz,
then one day you will discover you got

xxx/yyy/qqq .

Real "mv" doesn't have this bug.

$ mv k /tmp/p/
mv: cannot create regular file '/tmp/p/': Not a directory

dired-do-rename perhaps under the hood does the "mv" action, but instead
of reporting the failure, tries again with the final slash removed!

emacs-version "26.3"




This bug report was last modified 4 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.