From 1bd405d10fee69a5110ad0332bba3ce66487ee4c Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Tue, 9 May 2023 22:20:25 +0200
Subject: [PATCH] Add support for paths with spaces

---
 compile.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compile.sh b/compile.sh
index 32607cd..63733a9 100755
--- a/compile.sh
+++ b/compile.sh
@@ -221,7 +221,8 @@ then
 
     if is_truthy "${NATIVE_WINDOWS}"
     then
-        PROJECT_FILE="$projectFile" LOG_FILE="$logFile" WSLENV="PROJECT_FILE/p:LOG_FILE/p" cmd.exe /c "C:\Keil_v5\UV4\UV4.exe" -j0 -b "%PROJECT_FILE%" -t "$targetName" -l "%LOG_FILE%";
+        winFile="$(PROJECT_FILE="$projectFile" WSLENV="PROJECT_FILE/p" cmd.exe /c echo "%PROJECT_FILE%")";
+        LOG_FILE="$logFile" WSLENV="LOG_FILE/p" cmd.exe /c @ "C:\Keil_v5\UV4\UV4.exe" -j0 -b "$winFile" -t "$targetName" -l "%LOG_FILE%";
     else
         WINEDEBUG=-all,fixme+event xvfb-run bash -c "dwm & wine \"C:\Keil_v5\UV4\UV4.exe\" -j0 -b \"$projectFile\" -t \"$targetName\" -l \"$logFile\"";
     fi;