# HG changeset patch # User Waqas Hussain # Date 1265848563 -18000 # Node ID a9e99897b2e8bc8564c14dd4460507bb0defac57 # Parent 5091548a3805f16f90bc01c867b86595da693aa4 modulemanager: Load plugin libraries in the same environment as the plugins. diff -r 5091548a3805 -r a9e99897b2e8 core/modulemanager.lua --- a/core/modulemanager.lua Thu Feb 11 05:34:53 2010 +0500 +++ b/core/modulemanager.lua Thu Feb 11 05:36:03 2010 +0500 @@ -398,7 +398,7 @@ f, n = pluginloader.load_code(lib, lib..".lib.lua"); end if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message - setfenv(f, setmetatable({ module = self }, { __index = _G })); + setfenv(f, self.environment); return f(); end