Browse Source

auto.lua: fix consistency on Windows

Sasha Szpakowski 1 year ago
parent
commit
1396e26626
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/scripts/auto.lua

+ 2 - 1
src/scripts/auto.lua

@@ -77,13 +77,14 @@ local function auto(name)
 	local out_data = ""
 	local out_data = ""
 	--go through the input file line-by-line
 	--go through the input file line-by-line
 	for line in src_file:lines() do
 	for line in src_file:lines() do
+		line = line:gsub("\r", "")
 		--if the line is non-empty
 		--if the line is non-empty
 		if #line > 0 then
 		if #line > 0 then
 			--set the counter to -1
 			--set the counter to -1
 			--this will start a new line (see tohex)
 			--this will start a new line (see tohex)
 			counter = -1
 			counter = -1
 			--append the output to what we had, plus a newline character (0x0a is newline)
 			--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
 		else
 			out_data = out_data .. "\n\t0x0a,"
 			out_data = out_data .. "\n\t0x0a,"
 		end
 		end