1
Fork 0
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:
Andy Wingo 2016-06-24 10:40:09 +02:00
parent 395582b218
commit 5ca24b6ba1
2 changed files with 14 additions and 12 deletions

View file

@ -3285,14 +3285,15 @@
(let ((fn (syntax->datum filename)))
(let ((tmp (datum->syntax
filename
(let ((t (%search-load-path fn)))
(if t
t
(syntax-violation
'include-from-path
"file not found in path"
x
filename))))))
(canonicalize-path
(let ((t (%search-load-path fn)))
(if t
t
(syntax-violation
'include-from-path
"file not found in path"
x
filename)))))))
(let ((fn tmp))
(list '#(syntax-object include ((top)) (hygiene guile)) fn)))))
tmp)

View file

@ -3204,10 +3204,11 @@
(let ((fn (syntax->datum #'filename)))
(with-syntax ((fn (datum->syntax
#'filename
(or (%search-load-path fn)
(syntax-violation 'include-from-path
"file not found in path"
x #'filename)))))
(canonicalize-path
(or (%search-load-path fn)
(syntax-violation 'include-from-path
"file not found in path"
x #'filename))))))
#'(include fn)))))))
(define-syntax unquote