X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-load.lisp;h=55a585d7b3f6017a9e43d3e8f032c7ccede85a3e;hb=57bf8a7e65a81a8cff946a65e7e33e3f9b948ac6;hp=d022e5574853dc27e055f7e412f733a32e1e9818;hpb=01488e5ddb6c8c10bc01bc9c502be1fe9de8e370;p=sbcl.git diff --git a/src/code/target-load.lisp b/src/code/target-load.lisp index d022e55..55a585d 100644 --- a/src/code/target-load.lisp +++ b/src/code/target-load.lisp @@ -139,8 +139,11 @@ (return-from load nil)) (let* ((real (probe-file stream)) (should-be-fasl-p - (and real (string= (pathname-type real) *fasl-file-type*)))) - (when (fasl-header-p stream :errorp should-be-fasl-p) + (and real (string-equal (pathname-type real) *fasl-file-type*)))) + ;; Don't allow empty .fasls, and assume other empty files + ;; are source files. + (when (and (or should-be-fasl-p (not (eql 0 (file-length stream)))) + (fasl-header-p stream :errorp should-be-fasl-p)) (return-from load (load-stream stream t))))) ;; Case 3: Open using the gived external format, process as source. (with-open-file (stream pathname :external-format external-format)