Merge #6958 from ZyX-I/fix-6957

This commit is contained in:
Justin M. Keyes
2017-07-04 21:56:05 +02:00
committed by GitHub
3 changed files with 36 additions and 3 deletions

View File

@@ -319,7 +319,14 @@ end
-- Dedent the given text and write it to the file name.
local function write_file(name, text, dont_dedent)
local file = io.open(name, 'w')
if not dont_dedent then
if type(text) == 'table' then
-- Byte blob
local bytes = text
text = ''
for _, char in ipairs(bytes) do
text = ('%s%c'):format(text, char)
end
elseif not dont_dedent then
text = dedent(text)
end
file:write(text)