auto.lua: fix consistency on Windows

This commit is contained in:
Sasha Szpakowski
2023-10-08 12:32:10 -03:00
parent ff45c308f4
commit 1396e26626
+2 -1
View File
@@ -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