Software /
code /
prosody
Diff
util/pluginloader.lua @ 4150:2894ca33ec45
util.pluginloader: Return file path on success in pluginloader.load_code().
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 20 Feb 2011 20:03:43 +0500 |
parent | 4149:3c1b153c2856 |
child | 4152:4d52812d018d |
line wrap: on
line diff
--- a/util/pluginloader.lua Sun Feb 20 20:01:05 2011 +0500 +++ b/util/pluginloader.lua Sun Feb 20 20:03:43 2011 +0500 @@ -62,7 +62,10 @@ 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;