From f22ac9eed6f36838f76c3b072a6221bda3b276e1 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Fri, 22 Oct 2004 18:30:32 +0000 Subject: [PATCH] o Make NAMESTRING-PARSE-ERROR also be a TYPE-ERROR. This is a work around for the case where an invalid character is passed to LOGICAL-PATHNAME, which is supposed to signal a type-error. o Make sure the result from LOGICAL-PATHNAME is really a logical-pathname. (May not be the best solution.) This fixes ansi-test logical-pathname.error.3 and logical-pathname.error.10. --- code/pathname.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/pathname.lisp b/code/pathname.lisp index acb083dc1..0eb6d8bab 100644 --- a/code/pathname.lisp +++ b/code/pathname.lisp @@ -4,7 +4,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pathname.lisp,v 1.70 2004/10/09 14:41:01 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pathname.lisp,v 1.71 2004/10/22 18:30:32 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -826,7 +826,7 @@ a host-structure or string." (namestring-parse-error-namestring condition) (namestring-parse-error-offset condition))) -(define-condition namestring-parse-error (parse-error) +(define-condition namestring-parse-error (parse-error type-error) ((complaint :reader namestring-parse-error-complaint :initarg :complaint) (arguments :reader namestring-parse-error-arguments :initarg :arguments :initform nil) @@ -1827,6 +1827,10 @@ a host-structure or string." :format-arguments (list pathspec) :datum pathspec :expected-type '(satisfies logical-pathname-namestring-p))) + ;; Make sure the result is a logical pathname. This can + ;; happen if the pathspec is stream, and the stream was opened + ;; with a pathname instead of a logical-pathname. + (check-type res logical-pathname) res))) -- GitLab