[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 03/03: Fix include-from-path when file found in relative
From: |
Andy Wingo |
Subject: |
[Guile-commits] 03/03: Fix include-from-path when file found in relative path |
Date: |
Fri, 24 Jun 2016 08:42:23 +0000 (UTC) |
wingo pushed a commit to branch master
in repository guile.
commit 5ca24b6ba1bc617e60a0a9b2ecad7f112e99ef9c
Author: Andy Wingo <address@hidden>
Date: Fri Jun 24 10:40:09 2016 +0200
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.
---
module/ice-9/psyntax-pp.scm | 17 +++++++++--------
module/ice-9/psyntax.scm | 9 +++++----
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/module/ice-9/psyntax-pp.scm b/module/ice-9/psyntax-pp.scm
index 3cd6035..e06ae82 100644
--- a/module/ice-9/psyntax-pp.scm
+++ b/module/ice-9/psyntax-pp.scm
@@ -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)
diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm
index a45353a..e68b4ca 100644
--- a/module/ice-9/psyntax.scm
+++ b/module/ice-9/psyntax.scm
@@ -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