aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-18 02:22:48 +0200
committerKim Alvefur <zash@zash.se>2014-09-18 02:22:48 +0200
commit1324a994958a3d4206640db57b11a7a6d504d83a (patch)
tree361f642064745fd1a6601050e7573062ff65e2ad /prosody
parent04368a22ef17c788d0a734b594f206a3c25f82fc (diff)
parente9fa1d1db3a14e8b0d989c3c3e983521034ad38c (diff)
downloadprosody-1324a994958a3d4206640db57b11a7a6d504d83a.tar.gz
prosody-1324a994958a3d4206640db57b11a7a6d504d83a.zip
Merge 0.10->trunk
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody7
1 files changed, 6 insertions, 1 deletions
diff --git a/prosody b/prosody
index 8fcee8e8..aab803c5 100755
--- a/prosody
+++ b/prosody
@@ -153,7 +153,12 @@ function sandbox_require()
local _real_require = require;
if not getfenv then
-- FIXME: This is a hack to replace getfenv() in Lua 5.2
- function getfenv(f) return debug.getupvalue(debug.getinfo(f or 1).func, 1); end
+ function getfenv(f)
+ local name, env = debug.getupvalue(debug.getinfo(f or 1).func, 1);
+ if name == "_ENV" then
+ return env;
+ end
+ end
end
function require(...)
local curr_env = getfenv(2);