diff options
| author | 2023-03-23 03:39:54 +1100 | |
|---|---|---|
| committer | 2023-03-23 03:39:54 +1100 | |
| commit | 00f317b3d321d25b3ca404870beb7e12b092c376 (patch) | |
| tree | 34b329250993a3439fc32ccc78582f9089471977 /plugins/inputmacro | |
| parent | 38aef3891af1bca4b43f5f5a7914bfb58253f15e (diff) | |
-ui/menu.cpp: Don't pass IPT_UI_BACK event to the implementation when dismissing the menu.
-plugins/autofire, plugins/inputmacro: Don't be so eager to create empty settings folders.
Diffstat (limited to 'plugins/inputmacro')
| -rw-r--r-- | plugins/inputmacro/inputmacro_persist.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/inputmacro/inputmacro_persist.lua b/plugins/inputmacro/inputmacro_persist.lua index 6519f3a048a..b8670800fa4 100644 --- a/plugins/inputmacro/inputmacro_persist.lua +++ b/plugins/inputmacro/inputmacro_persist.lua @@ -101,7 +101,7 @@ end local lib = { } function lib:load_settings() - filename = settings_path() .. '/' .. settings_filename() + local filename = settings_path() .. '/' .. settings_filename() local file = io.open(filename, 'r') if not file then return { } @@ -127,17 +127,17 @@ end function lib:save_settings(macros) local path = settings_path() local stat = lfs.attributes(path) - if not stat then - lfs.mkdir(path) - elseif stat.mode ~= 'directory' then + if stat and (stat.mode ~= 'directory') then emu.print_error(string.format('Error saving input macros: "%s" is not a directory', path)) return end - filename = path .. '/' .. settings_filename() + local filename = path .. '/' .. settings_filename() if #macros == 0 then os.remove(filename) return + elseif not stat then + lfs.mkdir(path) end local json = require('json') |
