Ticket #1036 (closed defect: fixed)
#'rename-file disregards filespec when supplying defaults
|Reported by:||orivej||Owned by:|
|Component:||ANSI CL Compliance||Version:||trunk|
rename-file filespec new-name should supply missing components of new-name from filespec, which it does wrong in the case of (rename-file (make-pathname :name "x.s") "y"). Presently CCL (1.8 and trunk on linuxx86) renames "x.s" to "y.s" because it resolves supplied filespec into its truename via intermediate conversion to a native namestring before supplying defaults.
This is a fix:
--- lib/pathnames.lisp.orig +++ lib/pathnames.lisp.new @@ -98,7 +98,7 @@ file, then the associated file is renamed." (let* ((original (truename file)) (original-namestring (native-translated-namestring original)) - (new-name (merge-pathnames new-name original)) + (new-name (merge-pathnames new-name (merge-pathnames file))) (new-namestring (native-translated-namestring new-name))) (unless new-namestring (error "~S can't be created." new-name))