From: Matt Birkholz Date: Thu, 18 Aug 2011 18:28:54 +0000 (-0700) Subject: Allow ../../ in .cdecl include statements. X-Git-Tag: release-9.2.0~347^2~2^2~9 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6a0134d984901bc43a69528201a529a218670589;p=mit-scheme.git Allow ../../ in .cdecl include statements. --- diff --git a/src/ffi/cdecls.scm b/src/ffi/cdecls.scm index e9abe5fa2..4ec536028 100644 --- a/src/ffi/cdecls.scm +++ b/src/ffi/cdecls.scm @@ -71,8 +71,9 @@ USA. ;; FILENAME relative to CWD (current working directory). ;; Abbreviates namestrings under TWD (topmost working, build directory). - (let* ((pathname (merge-pathnames - (pathname-default-type filename "cdecl") cwd)) + (let* ((pathname (->simple-pathname + (merge-pathnames (pathname-default-type filename "cdecl") + cwd))) (new-cwd (directory-pathname pathname)) (namestring (enough-namestring pathname twd)) (modtime (file-modification-time-indirect namestring)) @@ -99,6 +100,14 @@ USA. kernel) (kernel)))))) +(define (->simple-pathname pathname) + (let loop ((count 0) + (simpler (pathname-simplify pathname))) + (let ((again (pathname-simplify simpler))) + (cond ((fix:> count 100) (error "Could not simplify:" pathname)) + ((pathname=? again simpler) again) + (else (loop again (fix:1+ count))))))) + (define read-environment (make-top-level-environment '(*PARSER-CANONICALIZE-SYMBOLS?*) '(#f)))