From: Waqas Hussain Date: Sun, 20 Feb 2011 15:01:05 +0000 (+0500) Subject: util.pluginloader: Return full file path from internal file loader on success, not... X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=492c253d150aeb7edb6687eb9bf085be6c33133a;p=prosody.git util.pluginloader: Return full file path from internal file loader on success, not just the name. --- diff --git a/util/pluginloader.lua b/util/pluginloader.lua index 1aedd630..d9553537 100644 --- a/util/pluginloader.lua +++ b/util/pluginloader.lua @@ -20,15 +20,16 @@ local loadstring, pairs = loadstring, pairs; module "pluginloader" local function load_file(name) - local file, err; + local file, err, path; for i=1,#plugin_dir do - file, err = io_open(plugin_dir[i]..name); + path = plugin_dir[i]..name; + file, err = io_open(path); if file then break; end end if not file then return file, err; end local content = file:read("*a"); file:close(); - return content, name; + return content, path; end function load_resource(plugin, resource, loader)