From 41210f593d52ab4018dcffbd0f2c7e445a747710 Mon Sep 17 00:00:00 2001 From: mpeterv Date: Sat, 5 Dec 2015 19:59:40 +0300 Subject: [PATCH] Use Unix newlines when patching luaconf.h --- hererocks.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hererocks.py b/hererocks.py index 51d4283..599fdb1 100755 --- a/hererocks.py +++ b/hererocks.py @@ -357,9 +357,8 @@ class Lua(Program): ]) def patch_defines(self): - defines = os.linesep.join(self.defines) - redefines = os.linesep.join(self.redefines) - linesep = os.linesep.encode("UTF-8") + defines = "\n".join(self.defines) + redefines = "\n".join(self.redefines) luaconf_h = open(os.path.join("src", "luaconf.h"), "rb") luaconf_src = luaconf_h.read() @@ -367,13 +366,13 @@ class Lua(Program): body, _, tail = luaconf_src.rpartition(b"#endif") header, _, main = body.partition(b"#define") - first_define, main = main.split(linesep, 1) + first_define, main = main.split(b"\n", 1) luaconf_h = open(os.path.join("src", "luaconf.h"), "wb") - luaconf_h.write(header + b"#define" + first_define + linesep) - luaconf_h.write(defines.encode("UTF-8") + linesep) + luaconf_h.write(header + b"#define" + first_define + b"\n") + luaconf_h.write(defines.encode("UTF-8") + b"\n") luaconf_h.write(main) - luaconf_h.write(redefines.encode("UTF-8") + linesep) + luaconf_h.write(redefines.encode("UTF-8") + b"\n") luaconf_h.write(b"#endif") luaconf_h.write(tail) luaconf_h.close()