diff options
| -rw-r--r-- | ccwl/lang.scm | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/ccwl/lang.scm b/ccwl/lang.scm index 1189287..b52a5ab 100644 --- a/ccwl/lang.scm +++ b/ccwl/lang.scm @@ -69,18 +69,13 @@ it." (define (ccwl-load-helper file file-syntax) "Load ccwl source @var{file}. @var{file-syntax} is the syntax object wrapping @var{file}." - (if (file-exists? file) - (let ((source-path (canonicalize-path file))) - ;; Change directory before loading source file. The source - ;; file may reference other files with paths relative to its - ;; directory. - (call-with-current-directory (dirname source-path) - (lambda () - (load source-path ccwl-read)))) - (raise-continuable - (condition (ccwl-violation file-syntax) - (formatted-message "File ~a does not exist" - file))))) + (let ((source-path (resolve-file-syntax file file-syntax))) + (if (file-exists? source-path) + (load source-path ccwl-read) + (raise-continuable + (condition (ccwl-violation file-syntax) + (formatted-message "File ~a does not exist" + file)))))) (define-syntax-rule (ccwl-load file) "Load ccwl source @var{file}." |
