diff options
author | Kenichi Handa <handa@m17n.org> | 2010-01-13 10:33:19 +0900 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2010-01-13 10:33:19 +0900 |
commit | d1bf28dc12ef1a0f3cecbf78f38795db27b38574 (patch) | |
tree | f7030cdefb9d5d8423619e7d70273ae98c011821 /lisp/files.el | |
parent | dc954cb273234237b615b93b6368d4adbdea31c4 (diff) | |
parent | ca22a44072c65a233af5b4c12256dc5fd266cb85 (diff) | |
download | emacs-d1bf28dc12ef1a0f3cecbf78f38795db27b38574.tar.gz |
merge trunk
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 15 |
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. |