>From d9eaa4b234b71e4ce95a24dbac49843dbf1a71c6 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 4 Jul 2017 20:47:50 +0200 Subject: [PATCH] Fix a regression in the evauation of the import path During the expansion of an import expression such as (import foo) we'd look up for the inline file for the module under the name "foo.inline" and, if that check fails, we try again with just "foo". Let's instead return #f if the caller specified a fixed set of allowed extensions and none of them satisifes the checks. Introduced in f0aafa06. --- eval.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/eval.scm b/eval.scm index 736de382..93092745 100644 --- a/eval.scm +++ b/eval.scm @@ -1340,22 +1340,21 @@ (##sys#file-exists? fname #t #f #f)) (lambda (fname exts repo source) (define (test-extensions fname lst) - (if (null? lst) - (and (exists? fname) fname) - (let ((fn (##sys#string-append fname (car lst)))) - (if (exists? fn) - fn - (test-extensions fname (cdr lst)))))) + (and (pair? lst) + (let ((fn (##sys#string-append fname (car lst)))) + (if (exists? fn) + fn + (test-extensions fname (cdr lst)))))) (define (test fname) (test-extensions fname (cond ((pair? exts) exts) ; specific list of extensions ((not (feature? #:dload)) ; no dload -> source only - (list source-file-extension)) + (list source-file-extension "")) ((not exts) ; prefer compiled - (list ##sys#load-dynamic-extension source-file-extension)) + (list ##sys#load-dynamic-extension source-file-extension "")) (else ; prefer source - (list source-file-extension ##sys#load-dynamic-extension))))) + (list source-file-extension ##sys#load-dynamic-extension ""))))) (or (test (make-relative-pathname source fname)) (let loop ((paths (if repo (##sys#append -- 2.11.0