From b2bc52935d74786366922bef2fa4ea7ec2f8d2e8 Mon Sep 17 00:00:00 2001 From: Yogthos Date: Wed, 24 Jun 2026 10:22:10 -0400 Subject: [PATCH] Resolve relative slurp/io-reader paths against JOLT_PWD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit io/file already resolved a relative path against JOLT_PWD (the user's cwd before the launcher cd's to the repo root), but slurp and io/reader on a relative string path opened it against the process cwd — so a program run from its own directory couldn't read its own relative files (e.g. aero's (read-config "config.edn")). Route the string branches through project-relative, matching io/file. Internal callers pass already-resolved paths through read-file-string and are unaffected. --- host/chez/io.ss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/chez/io.ss b/host/chez/io.ss index ab9287b..0805bf8 100644 --- a/host/chez/io.ss +++ b/host/chez/io.ss @@ -211,7 +211,7 @@ ;; a byte input-stream shim (e.g. clj-http-lite's :as :stream body): drain it. ((and (htable? src) (jolt-truthy? (jolt-ref-get src (keyword "jolt" "input-stream")))) (decode-bytevector (drain-byte-stream src) (slurp-encoding opts))) - ((string? src) (read-file-string src)) + ((string? src) (read-file-string (project-relative src))) (else (error #f "slurp: unsupported source" src)))) (define (spit-append? opts) @@ -300,7 +300,7 @@ ((embedded-res? x) (host-new "StringReader" (embedded-res-content x))) ((and (jhost? x) (string=? (jhost-tag x) "url")) (host-new "StringReader" (read-file-string (url-strip-scheme (url-spec x))))) - ((string? x) (host-new "StringReader" (read-file-string x))) + ((string? x) (host-new "StringReader" (read-file-string (project-relative x)))) ((or (cseq? x) (empty-list-t? x) (pvec? x)) (host-new "StringReader" (seq-source->string x))) (else (host-new "StringReader" (jolt-str-render-one x)))))