emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 66bdf77: Signal an error in dired when moving to a directory that


From: Lars Ingebrigtsen
Subject: master 66bdf77: Signal an error in dired when moving to a directory that doesn't exist
Date: Thu, 6 Aug 2020 06:14:20 -0400 (EDT)

branch: master
commit 66bdf77adfa115ad16ec8557c250f0e5683262b0
Author: Nick Helm <nick@tenpoint.co.nz>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Signal an error in dired when moving to a directory that doesn't exist
    
    * lisp/dired-aux.el (dired-do-create-files): Give an error when
    apparently moving to a directory name, and that directory doesn't
    exist (bug#38707).
---
 lisp/dired-aux.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 777df79..6587d03 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1978,6 +1978,10 @@ Optional arg HOW-TO determines how to treat the target.
        (apply (car into-dir) operation rfn-list fn-list target (cdr into-dir))
       (if (not (or dired-one-file into-dir))
          (error "Marked %s: target must be a directory: %s" operation target))
+      (if (and (not (file-directory-p (car fn-list)))
+               (not (file-directory-p target))
+               (directory-name-p target))
+          (error "%s: Target directory does not exist: %s" operation target))
       ;; rename-file bombs when moving directories unless we do this:
       (or into-dir (setq target (directory-file-name target)))
       (dired-create-files



reply via email to

[Prev in Thread] Current Thread [Next in Thread]