mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
plugins/autofire: don't save 2bytes cfg file (#6960)
This commit is contained in:
parent
4f6f6e13c4
commit
33fbb85d59
@ -76,9 +76,14 @@ function lib:save_settings(buttons)
|
||||
end
|
||||
local json = require('json')
|
||||
local settings = serialize_settings(buttons)
|
||||
local data = json.stringify(settings, {indent = true})
|
||||
if string.len(data) <= 2 then
|
||||
os.remove(path .. get_settings_filename())
|
||||
return
|
||||
end
|
||||
local file = io.open(path .. get_settings_filename(), 'w')
|
||||
if file then
|
||||
file:write(json.stringify(settings, {indent = true}))
|
||||
file:write(data)
|
||||
file:close()
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user