1.0.12.39: Fix minor bug in new LOAD
authorRichard M Kreuter <kreuter@users.sourceforge.net>
Thu, 20 Dec 2007 01:15:40 +0000 (01:15 +0000)
committerRichard M Kreuter <kreuter@users.sourceforge.net>
Thu, 20 Dec 2007 01:15:40 +0000 (01:15 +0000)
* A HANDLER-CASE was wrapped around too large a form, leading to a
  misleading resignaling in some failure cases.

src/code/target-load.lisp
version.lisp-expr

index f78f98e..ed607ff 100644 (file)
@@ -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.~:>"
                      (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
             (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:
index 9099b73..e9a76ce 100644 (file)
@@ -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"