mirror of
https://github.com/mamedev/mame.git
synced 2024-11-18 10:06:19 +01:00
plugins/autofire: don't save 2bytes cfg file (#6960)
This commit is contained in:
parent
4f6f6e13c4
commit
33fbb85d59
1 changed files with 6 additions and 1 deletions
|
@ -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 a new issue