X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpathname.lisp;h=bd0471faa40ecf30a95f1378b21fcab11d1f939c;hb=5762f26aae78beaead9919074963f67d92794599;hp=7f9d4cfc6dee601314516c50b81a03bcd845503a;hpb=a647f35a48924c9bc1914e1286418309fc69704e;p=sbcl.git diff --git a/src/code/pathname.lisp b/src/code/pathname.lisp index 7f9d4cf..bd0471f 100644 --- a/src/code/pathname.lisp +++ b/src/code/pathname.lisp @@ -141,8 +141,20 @@ (when directory (ecase (pop directory) (:absolute - (pieces "/")) - (:relative)) + (let ((next (pop directory))) + (cond ((eq :home next) + (pieces "~")) + ((and (consp next) (eq :home (car next))) + (pieces "~") + (pieces (second next))) + ((and (plusp (length next)) (char= #\~ (char next 0))) + ;; The only place we need to escape the tilde. + (pieces "\\") + (pieces next)) + (next + (push next directory))) + (pieces "/"))) + (:relative)) (dolist (dir directory) (typecase dir ((member :up)