in DEFMETHOD forms (reported by Pluijzer)
* bug fix: DELETE-FILE once again works on logical pathnames (regression
since 1.0.30.49)
+ * bug fix: LOGICAL-PATHNAME signals a TYPE-ERROR if pathspec is specified
+ incorrectly.
* bug fix: redefinition of a class via DEFCLASS without :DEFAULT-INITARGS
removes previous default initargs (reported by Lars Rune Nøstdal and
Samium Gromoff)
;;; loaded yet.
(defvar *logical-pathname-defaults*)
+(defun logical-namestring-p (x)
+ (and (stringp x)
+ (ignore-errors
+ (typep (pathname x) 'logical-pathname))))
+
+(deftype logical-namestring ()
+ `(satisfies logical-namestring-p))
+
(defun logical-pathname (pathspec)
#!+sb-doc
"Converts the pathspec argument to a logical-pathname and returns it."
(values logical-pathname))
(if (typep pathspec 'logical-pathname)
pathspec
- (let ((res (parse-namestring pathspec nil *logical-pathname-defaults*)))
- (when (eq (%pathname-host res)
- (%pathname-host *logical-pathname-defaults*))
- (error "This logical namestring does not specify a host:~% ~S"
- pathspec))
- res)))
+ (flet ((oops (problem)
+ (error 'simple-type-error
+ :datum pathspec
+ :expected-type 'logical-namestring
+ :format-control "~S is not a valid logical namestring:~% ~A"
+ :format-arguments (list pathspec problem))))
+ (let ((res (handler-case
+ (parse-namestring pathspec nil *logical-pathname-defaults*)
+ (error (e) (oops e)))))
+ (when (eq (%pathname-host res)
+ (%pathname-host *logical-pathname-defaults*))
+ (oops "no host specified"))
+ res))))
\f
;;;; logical pathname unparsing
(assert (probe-file test))
(assert (delete-file test))
(assert (not (probe-file test)))))
+
+(with-test (:name :logical-pathname-type-error)
+ (assert (eq :type-error-ok
+ (handler-case (logical-pathname "FOO.txt")
+ (type-error () :type-error-ok))))
+ (assert (eq :type-error-ok
+ (handler-case (logical-pathname "SYS:%")
+ (type-error () :type-error-ok)))))
;;;; success
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.31.16"
+"1.0.31.17"