From 34b0bddbd24f1ad8b9ae9d43d9a36cae8f9b6290 Mon Sep 17 00:00:00 2001
From: Peter Ferrie <peter.ferrie@gmail.com>
Date: Fri, 22 Oct 2021 07:12:57 -0700
Subject: [PATCH] closer to byte-identical to Mac build

---
 bin/makesorted.js | 4 +++-
 bin/padto.js      | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/makesorted.js b/bin/makesorted.js
index 4e4dbd40f..e6c2a5ec2 100644
--- a/bin/makesorted.js
+++ b/bin/makesorted.js
@@ -1,6 +1,7 @@
 a = new ActiveXObject("scripting.filesystemobject")
 b = a.opentextfile("res\\GAMES.CONF")
 c = []
+q = a.createtextfile("build\\GAMES.CONF")
 
 while (!b.atendofstream)
 {
@@ -28,10 +29,11 @@ while (!b.atendofstream)
 
   if (d.length > 0)
   {
+    q.writeline(d)
     f = d.indexOf(",") + 1
     c.push(d.substr(f, e - f))
   }
 }
 
-a.createtextfile("build\\GAMES.CONF").write(c.toString().replace(/,/g, "\n"))
+q.writeline(d)
 a.createtextfile("build\\GAMES.SORTED").write(c.sort().toString().replace(/,/g, "\n"))
diff --git a/bin/padto.js b/bin/padto.js
index 2a2f48337..60a02fccd 100644
--- a/bin/padto.js
+++ b/bin/padto.js
@@ -1,5 +1,5 @@
 a = new ActiveXObject("scripting.filesystemobject")
 b = a.opentextfile(WScript.Arguments(1))
-c = b.readall()
+c = b.readall().replace(/\r\n/g, "\n")
 b.close()
 a.createtextfile(WScript.Arguments(1)).write(String(c + Array(512).join(String.fromCharCode(0))).substr(0, 512))