diff options
author | 2020-01-04 10:10:19 +0100 | |
---|---|---|
committer | 2020-01-04 10:10:19 +0100 | |
commit | 97642338756d08a9dc5817587d7bbd867e09df57 (patch) | |
tree | 463e58d237444b0878e9ef88a325e909c5840722 | |
parent | 88909dc0d01f34bacbbbc3da6a9df705123b2f42 (diff) |
made read_config in hiscore lua plugin more robust
-rw-r--r-- | plugins/hiscore/init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua index ded3f0e44d2..9bd6ba2276c 100644 --- a/plugins/hiscore/init.lua +++ b/plugins/hiscore/init.lua @@ -46,8 +46,10 @@ function hiscore.startplugin() emu.print_verbose( "hiscore: config found" ); local _conf = {} for line in io.lines(config_path) do - token, value = string.match(line, '([^ ]+) ([^ ]+)'); - _conf[token] = value; + token, spaces, value = string.match(line, '([^ ]+)([ ]+)([^ ]+)'); + if token ~= nil and token ~= '' then + _conf[token] = value; + end end hiscore_path = lfs.env_replace(_conf["hi_path"] or hiscore_path); timed_save = _conf["only_save_at_exit"] ~= "1" |