From aa1e17d95fc6ffe64147fd9ddbb9b0b38dca3e24 Mon Sep 17 00:00:00 2001
From: Sam Hocevar <sam@hocevar.net>
Date: Sun, 29 Apr 2012 15:32:02 +0000
Subject: [PATCH] build: fix for a fucking batch file limitation that won't let
 me iterate through a list of files containing spaces or parens.

---
 win32/Lol.Rules.props | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/win32/Lol.Rules.props b/win32/Lol.Rules.props
index a1c9e549..9a093423 100644
--- a/win32/Lol.Rules.props
+++ b/win32/Lol.Rules.props
@@ -48,10 +48,24 @@
 
     <!-- FIXME: not for the static library! -->
     <PostBuildEvent Condition="'$(Platform)'=='Win32'">
-      <Command>for %%I in ($(SdlLibs)) do xcopy /y /c /d %%I\*.dll "$(TargetDir)"</Command>
+      <Command>
+        set A=$(SdlLibs)
+        :again
+        for /f "tokens=1* delims=;" %%I in ("%A%") do (
+          if not "%%I" == "" xcopy /y /c /d "%%I"\*.dll "$(TargetDir)" &amp;&amp; set A=%%J
+          if not "%%I" == "" goto again
+        )
+      </Command>
     </PostBuildEvent>
     <PostBuildEvent Condition="'$(Platform)'=='x64'">
-      <Command>for %%I in ($(SdlLibs)) do xcopy /y /c /d %%I\*.dll "$(TargetDir)"</Command>
+      <Command>
+        set A=$(SdlLibs)
+        :again
+        for /f "tokens=1* delims=;" %%I in ("%A%") do (
+          if not "%%I" == "" xcopy /y /c /d "%%I"\*.dll "$(TargetDir)" &amp;&amp; set A=%%J
+          if not "%%I" == "" goto again
+        )
+      </Command>
     </PostBuildEvent>
 
     <!-- FIXME: not for the static library! -->