Skip to content

Commit 5941f53

Browse files
committed
Be smarter about coercing a pathname to a directory.
On many implementations, (file-namestring "/") returns NIL. On SBCL, it returns "". Abstract that difference away into NON-EMPTY-FILE-NAMESTRING and use it.
1 parent 2a2df10 commit 5941f53

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

quicklisp.lisp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,9 +1636,10 @@ the indexes in the header accordingly."
16361636
:dist-version <version>~%~%"))
16371637

16381638
(defvar *after-load-message*
1639-
(format nil "~&~% ==== quicklisp quickstart loaded ====~%~% ~
1639+
(format nil "~&~% ==== quicklisp quickstart ~A loaded ====~%~% ~
16401640
To continue with installation, evaluate: (quicklisp-quickstart:install)~%~% ~
1641-
For installation options, evaluate: (quicklisp-quickstart:help)~%~%"))
1641+
For installation options, evaluate: (quicklisp-quickstart:help)~%~%"
1642+
qlqs-info:*version*))
16421643

16431644
(defvar *after-initial-setup-message*
16441645
(with-output-to-string (*standard-output*)
@@ -1670,14 +1671,20 @@ the indexes in the header accordingly."
16701671
(write-string *help-message*)
16711672
t)
16721673

1674+
(defun non-empty-file-namestring (pathname)
1675+
(let ((string (file-namestring pathname)))
1676+
(unless (or (null string)
1677+
(equal string ""))
1678+
string)))
1679+
16731680
(defun install (&key ((:path *home*) *home*)
16741681
((:proxy *proxy-url*) *proxy-url*)
16751682
client-url
16761683
client-version
16771684
dist-url
16781685
dist-version)
16791686
(setf *home* (merge-pathnames *home* (truename *default-pathname-defaults*)))
1680-
(let ((name (file-namestring *home*)))
1687+
(let ((name (non-empty-file-namestring *home*)))
16811688
(when name
16821689
(warn "Making ~A part of the install pathname directory"
16831690
name)

0 commit comments

Comments
 (0)