From: Taylor R. Campbell Date: Fri, 12 Jan 2007 10:23:04 +0000 (+0000) Subject: Use FILE-REGULAR?, not FILE-EXISTS?, to test for the existence of files X-Git-Tag: 20090517-FFI~788 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=02be0a49e91f8d14c173615b90179b0b6c3c3041;p=mit-scheme.git Use FILE-REGULAR?, not FILE-EXISTS?, to test for the existence of files to load, to avoid accidentally trying to load directories that happen to have the same name sans type as files we're interested in. --- diff --git a/v7/src/runtime/load.scm b/v7/src/runtime/load.scm index bdee6edf4..905c03b7e 100644 --- a/v7/src/runtime/load.scm +++ b/v7/src/runtime/load.scm @@ -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")))))