aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-01-31 12:03:37 -0500
committerChong Yidong2011-01-31 12:03:37 -0500
commit6fa1f65165a76364fc4b808857f7bb06b014b0d6 (patch)
tree7aaffb012097f9134712c6f469462a61fd3653b9
parentdf61c79005470fad666b3c3ae257eef1e06bd079 (diff)
downloademacs-6fa1f65165a76364fc4b808857f7bb06b014b0d6.tar.gz
emacs-6fa1f65165a76364fc4b808857f7bb06b014b0d6.zip
* lisp/files.el (copy-directory): Fix arguments to the recursive call.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/files.el32
2 files changed, 19 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 286f1eeae65..9cb406d431d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12011-01-31 Chong Yidong <cyd@stupidchicken.com>
2
3 * files.el (copy-directory): Fix arguments to recursive call.
4
12011-01-29 Chong Yidong <cyd@stupidchicken.com> 52011-01-29 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * files.el (copy-directory): If destination is an existing 7 * files.el (copy-directory): If destination is an existing
diff --git a/lisp/files.el b/lisp/files.el
index 46597426191..d896020b27b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4767,26 +4767,24 @@ this happens by default."
4767 (file-name-nondirectory 4767 (file-name-nondirectory
4768 (directory-file-name directory)) 4768 (directory-file-name directory))
4769 newname)) 4769 newname))
4770 (if (and (file-exists-p newname) 4770 (and (file-exists-p newname)
4771 (not (file-directory-p newname))) 4771 (not (file-directory-p newname))
4772 (error "Cannot overwrite non-directory %s with a directory" 4772 (error "Cannot overwrite non-directory %s with a directory"
4773 newname)) 4773 newname))
4774 (make-directory newname t)) 4774 (make-directory newname t))
4775 4775
4776 ;; Copy recursively. 4776 ;; Copy recursively.
4777 (mapc 4777 (dolist (file
4778 (lambda (file) 4778 ;; We do not want to copy "." and "..".
4779 (let ((target (expand-file-name 4779 (directory-files directory 'full
4780 (file-name-nondirectory file) newname)) 4780 directory-files-no-dot-files-regexp))
4781 (attrs (file-attributes file))) 4781 (if (file-directory-p file)
4782 (cond ((file-directory-p file) 4782 (copy-directory file newname keep-time parents)
4783 (copy-directory file target keep-time parents)) 4783 (let ((target (expand-file-name (file-name-nondirectory file) newname))
4784 ((stringp (car attrs)) ; Symbolic link 4784 (attrs (file-attributes file)))
4785 (make-symbolic-link (car attrs) target t)) 4785 (if (stringp (car attrs)) ; Symbolic link
4786 (t 4786 (make-symbolic-link (car attrs) target t)
4787 (copy-file file target t keep-time))))) 4787 (copy-file file target t keep-time)))))
4788 ;; We do not want to copy "." and "..".
4789 (directory-files directory 'full directory-files-no-dot-files-regexp))
4790 4788
4791 ;; Set directory attributes. 4789 ;; Set directory attributes.
4792 (set-file-modes newname (file-modes directory)) 4790 (set-file-modes newname (file-modes directory))