diff options
author | 2020-01-04 16:09:27 -0500 | |
---|---|---|
committer | 2020-01-04 16:09:27 -0500 | |
commit | 9730b87bbc17ba5f8b078ba94317c8c5dbd47e21 (patch) | |
tree | 7d9260329fd0219ca3cd6fd04068bdefad3dd51f /plugins/hiscore/init.lua | |
parent | 4c40152837f0625242be10264fa0fa47d8bc1c72 (diff) | |
parent | 97642338756d08a9dc5817587d7bbd867e09df57 (diff) |
Merge pull request #6129 from eadmaster/patch-1
made read_config in hiscore lua plugin more robust
Diffstat (limited to 'plugins/hiscore/init.lua')
-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" |