Use FILE-REGULAR?, not FILE-EXISTS?, to test for the existence of files
authorTaylor R. Campbell <net/mumble/campbell>
Fri, 12 Jan 2007 10:23:04 +0000 (10:23 +0000)
committerTaylor R. Campbell <net/mumble/campbell>
Fri, 12 Jan 2007 10:23:04 +0000 (10:23 +0000)
to load, to avoid accidentally trying to load directories that happen
to have the same name sans type as files we're interested in.

v7/src/runtime/load.scm

index bdee6edf4d97e6b03e9f43270b8f614d55dadaab..905c03b7ea7acf4cd05a660ca70902dc802ac4bf 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: load.scm,v 14.83 2007/01/05 21:19:28 cph Exp $
+$Id: load.scm,v 14.84 2007/01/12 10:23:04 riastradh Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -175,7 +175,7 @@ USA.
                                                find-pathname
                                                (list filename default-types))
                          default-types))))
-    (cond ((file-exists? pathname)
+    (cond ((file-regular? pathname)
           (values pathname
                   (let ((find-loader
                          (lambda (extension)
@@ -206,7 +206,7 @@ USA.
                 (loop (cdr types)))))
          (else
           (let ((pathname (pathname-new-type pathname (caar types))))
-            (if (file-exists? pathname)
+            (if (file-regular? pathname)
                 (values pathname (cadar types))
                 (loop (cdr types))))))))
 
@@ -348,7 +348,7 @@ USA.
                 (let ((find
                        (lambda (type)
                          (let ((pathname (pathname-new-type pathname type)))
-                           (and (file-exists? pathname)
+                           (and (file-regular? pathname)
                                 pathname)))))
                   (or (find "so")
                       (find "sl")))))