From f2b65035e35f3f7ae5f645cea6338538235ca899 Mon Sep 17 00:00:00 2001 From: Richard M Kreuter Date: Thu, 20 Dec 2007 01:15:40 +0000 Subject: [PATCH] 1.0.12.39: Fix minor bug in new LOAD * A HANDLER-CASE was wrapped around too large a form, leading to a misleading resignaling in some failure cases. --- src/code/target-load.lisp | 19 +++++++++++-------- version.lisp-expr | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/code/target-load.lisp b/src/code/target-load.lisp index f78f98e..ed607ff 100644 --- a/src/code/target-load.lisp +++ b/src/code/target-load.lisp @@ -64,7 +64,7 @@ (define-condition load-race-condition (error) ((pathname :reader load-race-condition-pathname :initarg :pathname)) (:report (lambda (condition stream) - (format stream "~@" + (format stream "~@" (load-race-condition-pathname condition))))) (defmacro resignal-race-condition (&body body) @@ -85,9 +85,9 @@ ;;; some defaulting in case the user asks us to load a file that ;;; doesn't exist at the time we start. (defun %load (pathspec &key (verbose *load-verbose*) (print *load-print*) - (if-does-not-exist t) (external-format :default)) + (if-does-not-exist t) (external-format :default)) (when (streamp pathspec) - (let* (;; Bindings required by ANSI. + (let* ( ;; Bindings required by ANSI. (*readtable* *readtable*) (*package* (sane-package)) ;; FIXME: we should probably document the circumstances @@ -142,11 +142,14 @@ (file-position stream :start) (return-from %load (%load stream :verbose verbose :print print)))))) - (resignal-race-condition - (with-open-file (stream pathspec - :external-format - external-format) - (%load stream :verbose verbose :print print)))) + ;; Because we're just opening for input, we don't need + ;; WITH-OPEN-FILE's abort handling semantics, and we want to say + ;; it's an error for PATHSPEC to have existed before but not now, so + ;; WITH-OPEN-STREAM it is. + (with-open-stream (stream (resignal-race-condition + (open pathspec + :external-format external-format))) + (%load stream :verbose verbose :print print))) ;; Given a simple %LOAD like the above, one can implement any ;; particular defaulting strategy with a wrapper like this one: diff --git a/version.lisp-expr b/version.lisp-expr index 9099b73..e9a76ce 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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.12.38" +"1.0.12.39" -- 1.7.10.4