From 1396e2662631921c46d2a452076a808691e6da9d Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sun, 8 Oct 2023 12:32:10 -0300 Subject: [PATCH] auto.lua: fix consistency on Windows --- src/scripts/auto.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripts/auto.lua b/src/scripts/auto.lua index ce59487f6..f9fa450ea 100644 --- a/src/scripts/auto.lua +++ b/src/scripts/auto.lua @@ -77,13 +77,14 @@ local function auto(name) local out_data = "" --go through the input file line-by-line for line in src_file:lines() do + line = line:gsub("\r", "") --if the line is non-empty if #line > 0 then --set the counter to -1 --this will start a new line (see tohex) counter = -1 --append the output to what we had, plus a newline character (0x0a is newline) - out_data = ("%s%s0x0a,"):format(out_data, line:gsub("\r", ""):gsub(".", tohex)) + out_data = ("%s%s0x0a,"):format(out_data, line:gsub(".", tohex)) else out_data = out_data .. "\n\t0x0a," end