mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix include-from-path when file found in relative path
* module/ice-9/psyntax.scm (include-from-path): Canonicalize result of %search-load-path. Otherwise a relative path passed to `include' would be treated as relative to the directory of the file that contains the `include-from-path'. Fixes #21347. * module/ice-9/psyntax-pp.scm: Regenerate.
This commit is contained in:
parent
395582b218
commit
5ca24b6ba1
2 changed files with 14 additions and 12 deletions
|
@ -3285,6 +3285,7 @@
|
|||
(let ((fn (syntax->datum filename)))
|
||||
(let ((tmp (datum->syntax
|
||||
filename
|
||||
(canonicalize-path
|
||||
(let ((t (%search-load-path fn)))
|
||||
(if t
|
||||
t
|
||||
|
@ -3292,7 +3293,7 @@
|
|||
'include-from-path
|
||||
"file not found in path"
|
||||
x
|
||||
filename))))))
|
||||
filename)))))))
|
||||
(let ((fn tmp))
|
||||
(list '#(syntax-object include ((top)) (hygiene guile)) fn)))))
|
||||
tmp)
|
||||
|
|
|
@ -3204,10 +3204,11 @@
|
|||
(let ((fn (syntax->datum #'filename)))
|
||||
(with-syntax ((fn (datum->syntax
|
||||
#'filename
|
||||
(canonicalize-path
|
||||
(or (%search-load-path fn)
|
||||
(syntax-violation 'include-from-path
|
||||
"file not found in path"
|
||||
x #'filename)))))
|
||||
x #'filename))))))
|
||||
#'(include fn)))))))
|
||||
|
||||
(define-syntax unquote
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue