guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/5] [mingw]: Have compiled-file-name produce valid names.


From: Jan Nieuwenhuizen
Subject: [PATCH 2/5] [mingw]: Have compiled-file-name produce valid names.
Date: Tue, 15 Feb 2011 16:35:00 +0100

From: Jan Nieuwenhuizen <address@hidden>

2011-02-04  Jan Nieuwenhuizen  <address@hidden>

    * module/system/base/compile.scm (compiled-file-name): Add
    directory separator and remove colon for Mingw.  Fixes
    compilation on Windows.
---
 module/system/base/compile.scm |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm
index 7d46713..8c72e54 100644
--- a/module/system/base/compile.scm
+++ b/module/system/base/compile.scm
@@ -100,11 +100,16 @@
            ".go")
           (else (car %load-compiled-extensions))))
   (and %compile-fallback-path
-       (let ((f (string-append
+       (let* ((c (canonicalize-path file))
+             (f (string-append
                  %compile-fallback-path
                  ;; no need for '/' separator here, canonicalize-path
                  ;; will give us an absolute path
-                 (canonicalize-path file)
+                (if (eq? (string-ref c 1) #\:)
+                    ;; on Mingw remove drive-letter separator `:' to
+                    ;; obtain valid file name
+                    (substring c 2)
+                    c)
                  (compiled-extension))))
          (and (false-if-exception (ensure-writable-dir (dirname f)))
               f))))
-- 
1.7.1

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]