From: Richard M Kreuter <kreuter@us...> - 2007-12-20 01:15:44
Update of /cvsroot/sbcl/sbcl/src/code
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3591/src/code
18.104.22.168: 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.
RCS file: /cvsroot/sbcl/sbcl/src/code/target-load.lisp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- target-load.lisp 17 Dec 2007 23:00:23 -0000 1.41
+++ target-load.lisp 20 Dec 2007 01:15:40 -0000 1.42
@@ -64,7 +64,7 @@
(define-condition load-race-condition (error)
((pathname :reader load-race-condition-pathname :initarg :pathname))
(:report (lambda (condition stream)
- (format stream "~@<File~S was deleted or renamed during LOAD.~:>"
+ (format stream "~@<File ~S was deleted or renamed during LOAD.~:>"
(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.
;; FIXME: we should probably document the circumstances
@@ -142,11 +142,14 @@
(file-position stream :start)
(%load stream :verbose verbose :print print))))))
- (with-open-file (stream pathspec
- (%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: