Skip to content
Snippets Groups Projects
Commit fe883f7e authored by ram's avatar ram
Browse files

Fixed load to not always consider files with NIL type to be source files. If

the file exists as specified, then look at the header instead of trying to
default the type.  If :CONTENTS is specified, then don't try defaulting types.
parent cb6c68e7
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.48 1993/02/26 08:25:47 ram Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.49 1993/03/01 18:16:24 ram Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -36,7 +36,7 @@
(declaim (type (member :load-object :load-source :query :compile)
*load-if-source-newer*))
(defvar *load-source-types* '("lisp" "l" "cl" "lsp" nil)
(defvar *load-source-types* '("lisp" "l" "cl" "lsp")
"The source file types which LOAD recognizes.")
(defvar *load-object-types*
......@@ -492,8 +492,9 @@
:CONTENTS {NIL | :SOURCE | :BINARY}
Forces the input to be interpreted as a source or object file, instead
of guessing based on the file type. Probably only necessary if you have
source files with a \"fasl\" type.
of guessing based on the file type. This also inhibits file type
defaulting. Probably only necessary if you have source files with a
\"fasl\" type.
The variables *LOAD-VERBOSE*, *LOAD-PRINT* and EXT:*LOAD-IF-SOURCE-NEWER*
determine the defaults for the corresponding keyword arguments. These
......@@ -531,15 +532,14 @@
(sloload filename))
(let ((pn (merge-pathnames (pathname filename)
*default-pathname-defaults*)))
(cond ((wild-pathname-p pn)
(dolist (file (directory pn) t)
(internal-load pn file if-does-not-exist contents)))
((pathname-type pn)
(internal-load pn (probe-file pn) if-does-not-exist
contents))
(t
(internal-load-default-type
pn if-does-not-exist)))))))))))
(if (wild-pathname-p pn)
(dolist (file (directory pn) t)
(internal-load pn file if-does-not-exist contents))
(let ((tn (probe-file pn)))
(if (or tn (pathname-type pn) contents)
(internal-load pn tn if-does-not-exist contents)
(internal-load-default-type
pn if-does-not-exist))))))))))))
;;; INTERNAL-LOAD -- Internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment