mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Making uri-resolve work with bare local paths.
This commit is contained in:
parent
4e5cdedc03
commit
55329e39fb
1 changed files with 10 additions and 9 deletions
|
@ -331,13 +331,14 @@
|
|||
;;> any components of \var{path} are missing, or if \var{path} is a
|
||||
;;> raw path, it is taken relative to \var{uri}.
|
||||
|
||||
(define (uri-resolve path uri)
|
||||
(define (uri-resolve path orig-uri)
|
||||
(or (string->uri path)
|
||||
(let ((uri (string->uri uri)))
|
||||
(and uri
|
||||
(let ((uri (string->uri orig-uri)))
|
||||
(if uri
|
||||
(uri-with-path
|
||||
(uri-with-fragment (uri-with-query uri #f) #f)
|
||||
(path-resolve path
|
||||
(if (string-suffix? (uri-path uri) "/")
|
||||
(uri-path uri)
|
||||
(path-directory (uri-path uri)))))))))
|
||||
(path-directory (uri-path uri)))))
|
||||
(path-resolve path orig-uri)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue