0.8.14.3:
[sbcl.git] / src / code / filesys.lisp
index 6cd3d31..3bf1a5a 100644 (file)
       ;; translating logical pathnames to a filesystem without
       ;; versions (like Unix).
       (when name
-       (when (and (null type) (position #\. name :start 1))
+       (when (and (null type)
+                  (typep name 'string)
+                  (> (length name) 0)
+                  (position #\. name :start 1))
          (error "too many dots in the name: ~S" pathname))
+       (when (and (typep name 'string)
+                  (string= name ""))
+         (error "name is of length 0: ~S" pathname))
        (strings (unparse-unix-piece name)))
       (when type-supplied
        (unless name
             (defaults-directory (%pathname-directory defaults))
             (prefix-len (length defaults-directory))
             (result-directory
-             (cond ((and (> prefix-len 1)
+             (cond ((null pathname-directory) '(:relative))
+                   ((eq (car pathname-directory) :relative)
+                    pathname-directory)
+                   ((and (> prefix-len 1)
                          (>= (length pathname-directory) prefix-len)
                          (compare-component (subseq pathname-directory
                                                     0 prefix-len)
                     ;; We are an absolute pathname, so we can just use it.
                     pathname-directory)
                    (t
-                    ;; We are a relative directory. So we lose.
-                    (lose)))))
+                    (bug "Bad fallthrough in ~S" 'unparse-unix-enough)))))
        (strings (unparse-unix-directory-list result-directory)))
       (let* ((pathname-type (%pathname-type pathname))
             (type-needed (and pathname-type