Fix #136: ensure-directories-exist should return the given pathspec

The CLHS says

The primary value is the given pathspec so that this operation can be straightforwardly composed with other file manipulation expressions.

The ansi tests interpret this to mean that the first arg should be returned as is.

Previously, Cmucl was merging the pathspec with *default-pathname-defaults* and returning that.

Merge request reports

Loading
+1 −1
Changes for src/code/filesys.lisp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1478,4 +1478,4 @@ optionally keeping some of the most recent old versions."
			 (retry () :report "Try to create the directory again"
				(go retry))))))
	 ;; Only the first path in a search-list is considered.
	 (return (values pathname created-p))))))
	 (return (values pathspec created-p))))))
+3 −3
Changes for tests/filesys.lisp: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@

(define-test unix-namestring.1.exists
  ;; Make sure the desired directories exist.
  (assert-equal #P"/tmp/foo/bar/hello.txt"
  (assert-equal "/tmp/foo/bar/hello.txt"
		(ensure-directories-exist "/tmp/foo/bar/hello.txt"))
  (dolist (path '("/tmp/hello.txt"
		  "/tmp/foo/"
@@ -27,7 +27,7 @@

(define-test unix-namestring.1.non-existent
  ;; Make sure the desired directories exist.
  (assert-equal #P"/tmp/foo/bar/hello.txt"
  (assert-equal "/tmp/foo/bar/hello.txt"
		(ensure-directories-exist "/tmp/foo/bar/hello.txt"))
  ;; These paths contain directories that don't exist.
  (dolist (path '("/tmp/oops/"
@@ -42,7 +42,7 @@

(define-test unix-namestring.2
  ;; Make sure the desired directories exist.
  (assert-equal #P"/tmp/foo/bar/hello.txt"
  (assert-equal "/tmp/foo/bar/hello.txt"
		(ensure-directories-exist "/tmp/foo/bar/hello.txt"))
  (unwind-protect
       (progn
Loading