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.
This commit is contained in:
Jan Nieuwenhuizen 2019-02-25 20:51:37 +01:00
parent ffafec7073
commit 2410f48871
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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))