From 97642338756d08a9dc5817587d7bbd867e09df57 Mon Sep 17 00:00:00 2001 From: Andrea <925171+eadmaster@users.noreply.github.com> Date: Sat, 4 Jan 2020 10:10:19 +0100 Subject: made read_config in hiscore lua plugin more robust --- plugins/hiscore/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins') 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" -- cgit v1.2.3-70-g09d2