]> git.eshelyaron.com Git - emacs.git/commitdiff
* files.el (delete-directory): Delete symlinks to directories with
authorChong Yidong <cyd@stupidchicken.com>
Sat, 24 Oct 2009 20:30:44 +0000 (20:30 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 24 Oct 2009 20:30:44 +0000 (20:30 +0000)
delete-file (Bug#4739).

lisp/ChangeLog
lisp/files.el

index 2b05d3dd6ae021637fa452e2e0c13af96868ea23..5387cfd080e6310f3530284a090b30100c3e6857 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-24  Sven Joachim  <svenjoac@gmx.de>
+
+       * files.el (delete-directory): Delete symlinks to directories with
+       delete-file (Bug#4739).
+
 2009-10-24  Chong Yidong  <cyd@stupidchicken.com>
 
        * cedet/semantic/util.el (semantic-recursive-find-nonterminal-by-name):
index ce9791fdaaead0faa693c9501678e533ab84ea36..16210bfbadb6883ad1b5f87947e8f0de1bb461c0 100644 (file)
@@ -4660,7 +4660,10 @@ If RECURSIVE is non-nil, all files in DIRECTORY are deleted as well."
       (if (and recursive (not (file-symlink-p directory)))
          (mapc
           (lambda (file)
-            (if (file-directory-p file)
+            ;; This test is equivalent to
+            ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
+            ;; but more efficient
+            (if (eq t (car (file-attributes file)))
                 (delete-directory file recursive)
               (delete-file file)))
           ;; We do not want to delete "." and "..".