aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-10-14 10:59:54 +0100
committerMatthew Wild <mwild1@gmail.com>2014-10-14 10:59:54 +0100
commit49c32aaaeb47bdcef6522136cd9b096ce84e97b9 (patch)
tree5ad39be8aac11ff828d4ff5a36227b480a509cb3 /prosody
parente58a22fd47b0b0b50ae06527df8fa23f02e1c6a6 (diff)
parent4d822c8eaf0556bc2a0e3cfd5dcb71fa8fedc9d2 (diff)
downloadprosody-49c32aaaeb47bdcef6522136cd9b096ce84e97b9.tar.gz
prosody-49c32aaaeb47bdcef6522136cd9b096ce84e97b9.zip
Merge 0.10->trunk
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody10
1 files changed, 4 insertions, 6 deletions
diff --git a/prosody b/prosody
index aab803c5..e8f81d5d 100755
--- a/prosody
+++ b/prosody
@@ -151,13 +151,11 @@ function sandbox_require()
-- for neat sandboxing of modules
local _realG = _G;
local _real_require = require;
- if not getfenv then
+ local getfenv = getfenv or function (f)
-- FIXME: This is a hack to replace getfenv() in Lua 5.2
- function getfenv(f)
- local name, env = debug.getupvalue(debug.getinfo(f or 1).func, 1);
- if name == "_ENV" then
- return env;
- end
+ local name, env = debug.getupvalue(debug.getinfo(f or 1).func, 1);
+ if name == "_ENV" then
+ return env;
end
end
function require(...)