Skip to content

Commit

Permalink
auto.lua: fix consistency on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Oct 8, 2023
1 parent ff45c30 commit 1396e26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scripts/auto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1396e26

Please sign in to comment.