aboutsummaryrefslogtreecommitdiffstats
path: root/util/pluginloader.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2011-02-20 20:03:43 +0500
committerWaqas Hussain <waqas20@gmail.com>2011-02-20 20:03:43 +0500
commit55f906ce99f7c73cf4ccb4084ddf89ee85f97270 (patch)
treee064a3228ce5a9c1712f0ad7a2befe9e2c1c4dca /util/pluginloader.lua
parente8e82713fe030d88912c6962e620de54121223de (diff)
downloadprosody-55f906ce99f7c73cf4ccb4084ddf89ee85f97270.tar.gz
prosody-55f906ce99f7c73cf4ccb4084ddf89ee85f97270.zip
util.pluginloader: Return file path on success in pluginloader.load_code().
Diffstat (limited to 'util/pluginloader.lua')
-rw-r--r--util/pluginloader.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/pluginloader.lua b/util/pluginloader.lua
index d9553537..9300b98a 100644
--- a/util/pluginloader.lua
+++ b/util/pluginloader.lua
@@ -62,7 +62,10 @@ end
function load_code(plugin, resource)
local content, err = load_resource(plugin, resource);
if not content then return content, err; end
- return loadstring(content, "@"..err);
+ local path = err;
+ local f, err = loadstring(content, "@"..path);
+ if not f then return f, err; end
+ return f, path;
end
return _M;