From 77e75c3142eb8c328da7163b2847e2a70ee7ca5d Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 27 May 2019 21:51:37 +0200 Subject: [PATCH] mes: Bugfix for search-path. Fixes running MesCC on Guile. * module/mescc/mescc.scm (arch-find): Also look in cwd. * mes/module/mes/posix.mes (search-path): Do not look in cwd. --- mes/module/mes/posix.mes | 11 +++++------ module/mescc/mescc.scm | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mes/module/mes/posix.mes b/mes/module/mes/posix.mes index 77785406..fc1b1574 100644 --- a/mes/module/mes/posix.mes +++ b/mes/module/mes/posix.mes @@ -38,12 +38,11 @@ *unspecified*) (define (search-path path file-name) - (if (access? file-name R_OK) file-name - (let loop ((path path)) - (and (pair? path) - (let ((f (string-append (car path) "/" file-name))) - (if (access? f R_OK) f - (loop (cdr path)))))))) + (let loop ((path path)) + (and (pair? path) + (let ((f (string-append (car path) "/" file-name))) + (if (access? f R_OK) f + (loop (cdr path))))))) (define (execlp file-name args) (let ((executable (if (string-index file-name #\/) file-name diff --git a/module/mescc/mescc.scm b/module/mescc/mescc.scm index 8a86d9b9..45f9c913 100644 --- a/module/mescc/mescc.scm +++ b/module/mescc/mescc.scm @@ -274,7 +274,8 @@ ((equal? machine "32") "x86-mes") ((equal? machine "64") "x86_64-mes") (else "x86-mes"))) - (path (cons* srcdir-lib + (path (cons* "." + srcdir-lib (prefix-file options "lib") (filter-map (multi-opt 'library-dir) options))) (arch-file-name (string-append arch "/" file-name))