Hi all,

I finally gathered enough gumption to spin up a Windows VM and
test the patch from #1727.  It seems to work properly, so here
is a signed-off version of the patch.

Cheers,
Peter
From 46fd66aef7b2345a92ac944282b313a8a584202d Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <m...@vasilij.de>
Date: Sun, 11 Apr 2021 20:01:23 +0200
Subject: [PATCH] Correctly quote set calls in Windows scripts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

According to ​https://ss64.com/nt/set.html, the set command should
quote its entire argument, including the name. Likewise, quotes inside
paths are illegal, therefore no quotes should be used inside PATH.

It appears that the Windows shell cannot deal with quoting inside an
argument, only when quotes surround the argument. This is not the case
on Unix environments at all.

Closes #1727

Signed-off-by: Peter Bex <pe...@more-magic.net>
---
 NEWS            |  3 +++
 egg-compile.scm | 16 ++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index e65f885a..90d62c7d 100644
--- a/NEWS
+++ b/NEWS
@@ -80,6 +80,9 @@
     cache directory matching its program name (#1713, thanks to Alice Maz)
   - Fixed bug in chicken-install regarding variable quotation on UNIX-like
     systems which prevented installation into paths with spaces (#1685).
+  - Fixed a similar bug in chicken-install for paths with spaces on mingw
+    and mingw-msys (#1727, thanks to Josh Helzer for reporting and Vasilij
+    Schneidermann for the patch)
 
 5.2.0
 
diff --git a/egg-compile.scm b/egg-compile.scm
index 186a7227..205505a6 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -1128,16 +1128,16 @@ EOF
     ((windows)
      (printf #<<EOF
 @echo off~%
-set PATH=~a;%PATH%
-set CHICKEN_CC=~a
-set CHICKEN_CXX=~a
-set CHICKEN_CSC=~a
-set CHICKEN_CSI=~a
+set "PATH=~a;%PATH%"
+set "CHICKEN_CC=~a"
+set "CHICKEN_CXX=~a"
+set "CHICKEN_CSC=~a"
+set "CHICKEN_CSI=~a"
 
 EOF
-             (qs* default-bindir platform) (qs* default-cc platform)
-	     (qs* default-cxx platform) (qs* default-csc platform)
-	     (qs* default-csi platform)))))
+             default-bindir default-cc
+	     default-cxx default-csc
+	     default-csi))))
 
 (define ((build-suffix mode name info) platform)
   (case platform
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

Reply via email to