X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpathname.lisp;h=deb6343bb5136b9af8e6b345df20b5737e3782d8;hb=18dc0069cd514c976042766ab9a785c970fe1603;hp=7f9d4cfc6dee601314516c50b81a03bcd845503a;hpb=a647f35a48924c9bc1914e1286418309fc69704e;p=sbcl.git diff --git a/src/code/pathname.lisp b/src/code/pathname.lisp index 7f9d4cf..deb6343 100644 --- a/src/code/pathname.lisp +++ b/src/code/pathname.lisp @@ -75,7 +75,7 @@ ;;; all pathname components (eval-when (#-sb-xc :compile-toplevel :load-toplevel :execute) (def!type pathname-component-tokens () - '(member nil :unspecific :wild))) + '(member nil :unspecific :wild :unc))) (sb!xc:defstruct (pathname (:conc-name %pathname-) (:constructor %make-pathname (host @@ -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)