aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commit6ae4c18ce76437a4b755bc1db31a36d82281d2bf (patch)
tree0410daf86bca24389d1287bc53eff79753b7a081 /util
parentcf8bb7899878272d41da09a9614a72531044369d (diff)
downloadprosody-6ae4c18ce76437a4b755bc1db31a36d82281d2bf.tar.gz
prosody-6ae4c18ce76437a4b755bc1db31a36d82281d2bf.zip
util.pluginloader: Return file path on success in pluginloader.load_code().
Diffstat (limited to 'util')
-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;