summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-08-04 16:49:11 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-08-04 16:49:11 -0500
commit4f25a90c756ca96a97e9eeb557fde624b3849944 (patch)
treef15de2228f874297f93c7cdb471e66aa891db63e /plugins
parent0f05950b9abb1ac3f83c40802864d18b1baf9cae (diff)
hiscore: make path expansion work on win32 also (nw)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/hiscore/init.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua
index fc67584bb07..c26c25ae21c 100644
--- a/plugins/hiscore/init.lua
+++ b/plugins/hiscore/init.lua
@@ -5,7 +5,6 @@
-- high-score saving with hiscore.dat infom just as older
-- builds did in the past.
--
-require('lfs')
local exports = {}
exports.name = "hiscore"
exports.version = "1.0.0"
@@ -24,8 +23,7 @@ function hiscore.startplugin()
local hiscoredata_path = "hiscore.dat";
local hiscore_path = "hi";
- local config_path = manager:options().entries.inipath:value():match("[^;]+") .. "/hiscore.ini";
- config_path = config_path:gsub("%$(%w+)", os.getenv);
+ local config_path = lfs.env_replace(manager:options().entries.inipath:value():match("[^;]+") .. "/hiscore.ini");
local current_checksum = 0;
local default_checksum = 0;
@@ -47,7 +45,7 @@ function hiscore.startplugin()
local _conf = {}
for line in io.lines(config_path) do
token, value = string.match(line, '([^ ]+) ([^ ]+)');
- _conf[token] = value:gsub("%$(%w+)", os.getenv);
+ _conf[token] = lfs.env_replace(value);
end
hiscore_path = _conf["hi_path"];
-- hiscoredata_path = _conf["dat_path"]; -- don't know if I should do it, but wathever