summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2010-01-13 10:33:19 +0900
committerKenichi Handa <handa@m17n.org>2010-01-13 10:33:19 +0900
commitd1bf28dc12ef1a0f3cecbf78f38795db27b38574 (patch)
treef7030cdefb9d5d8423619e7d70273ae98c011821 /lisp/files.el
parentdc954cb273234237b615b93b6368d4adbdea31c4 (diff)
parentca22a44072c65a233af5b4c12256dc5fd266cb85 (diff)
downloademacs-d1bf28dc12ef1a0f3cecbf78f38795db27b38574.tar.gz
merge trunk
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 22f5936a1f6..302f114befe 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4714,20 +4714,17 @@ this happens by default."
;; Compute target name.
(setq directory (directory-file-name (expand-file-name directory))
newname (directory-file-name (expand-file-name newname)))
- (if (and (file-directory-p newname)
- (not (string-equal (file-name-nondirectory directory)
- (file-name-nondirectory newname))))
- (setq newname
- (expand-file-name (file-name-nondirectory directory) newname)))
(if (not (file-directory-p newname)) (make-directory newname parents))
;; Copy recursively.
(mapc
(lambda (file)
- (if (file-directory-p file)
- (copy-directory file newname keep-time parents)
- (copy-file file newname t keep-time)))
- ;; We do not want to delete "." and "..".
+ (let ((target (expand-file-name
+ (file-name-nondirectory file) newname)))
+ (if (file-directory-p file)
+ (copy-directory file target keep-time parents)
+ (copy-file file target t keep-time))))
+ ;; We do not want to copy "." and "..".
(directory-files directory 'full directory-files-no-dot-files-regexp))
;; Set directory attributes.